07 Jul 2023 07:17 PM
I have several cases where I need to ingest logs into Dynatrace from scripts that I control, in servers where OneAgent is running.
Now, I try to ingest them directly through the OneAgent log ingest API: https://www.dynatrace.com/support/help/extend-dynatrace/extend-logs/oneagent-log-ingest-api
I do this for several reasons:
I sometimes have doubts if there are disadvantages in this approach. For instance, it's way easier to dump into a file, and you don't have to code so much. You also have to be careful not committing errors. Are there other point of views, or how are you doing it yourself?
10 Jul 2023 07:14 AM
Hi Antonio:)
A mechanism that directly reads data from logs and sends relevant fragments to DT in the form of metrics works best. You can make a script that checks if an error has occurred, for example, and then sends the entire line of the entry related to this error to DT after the API.
Writing to files as you write has many disadvantages. You have to keep an eye on file compatibility, define appropriate data overwrite cycles, you use valuable resources, etc.
Regards,
Radek