Open Q&A
If there's no good subforum for your question - ask it here!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dynatrace_ingest for logs?

AntonioSousa
DynaMight Guru
DynaMight Guru

dynatrace_ingest can ingest metrics locally. But if we want to ingest logs locally, suggested way is with a curl command.
Is there a way to pipe output from a Linux/Windows command, through dynatrace_ingest, or something similar?

Antonio Sousa
3 REPLIES 3

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

If you have OneAgent, you can ingest custom logs base on tomcus log course and ingestion rules.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

@AntonPineiro ,

The idea is to not have log files in the first place, so I don't have to write to disk. Something like:

  • ./my_program -v | dynatrace_ingest
Antonio Sousa

JustSchwendi
Dynatrace Enthusiast
Dynatrace Enthusiast

You mean ingest logs from local to SaaS cluster?
For this use case, you would use the log ingest API and curl, or powershell.
You first need to create an API log.ingest token and then run somthing like 

tail -f /var/log/syslog | while read line; do
curl -X POST "http://<tenantFQDN>/v2/logs/ingest" \
-H "Content-Type: application/json" \
-H "Authorization: Api-Token <your-token>" \
-d "{\"content\": \"$line\"}"
done



In this blog, OTel was used to ingest logs extracted from a local json file on a raspberry pi:
Leverage edge IoT data with OpenTelemetry and Dynatrace
Details are explained in Step 5.

Hope this helps 🙂

Featured Posts