Reference – https://docs.datadoghq.com/api/latest/logs/
Step 1 – How to get API of Datadog Agent?
Step 2 – Go to Linux Cmd and run following commands.
Using Telnet
$ telnet intake.logs.datadoghq.com 10514
4396f0b432e47383f3dddddd3b1b7 Hell0 Everyone, this is Rajesh
4396f0b432e473ddddddb45cc3b1b7 Hell0 Everyone, this is Rajesh1
4396f0b432e47ddddd17b45cc3b1b7 Hell0 Everyone, this is Rajesh3
87b9dbcda7e5d069cd30a0f68154cca27 {"message":"Welcome to Datadog Session by DevOpsSchool - 1", "ddtags":"env:dev", "ddsource":"devopsschool-1", "hostname":"gs-hostame", "service":"user"}
87b9dbcda7ed5069cd30a0f68154cca27 {"message":"Welcome to Datadog Session by DevOpsSchool - 2", "ddtags":"env:prod", "ddsource":"devopsschool-2", "hostname":"gs-hostame", "service":"user"}
87b9dbcda7ed5069cd30a0f68154cca27 {"message":"Welcome to Datadog Session by DevOpsSchool - 3", "ddtags":"env:qa", "ddsource":"devopsschool-3", "hostname":"gs-hostame", "service":"user"}
87b9dbcda7de5069cd30a0f68154cca27 {"message":"Welcome to Datadog Session by DevOpsSchool - 4", "ddtags":"env:us", "ddsource":"devopsschool-3", "hostname":"gs-hostame", "service":"user"}
Using curl
curl -X POST "https://http-intake.logs.datadoghq.com/api/v2/logs" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: 87b9dbcda7e5069cd30a4468154cca27" \
-d @- << EOF
[
{
"ddsource": "nginx",
"ddtags": "env:staging,version:5.1",
"hostname": "i-012345678",
"message": "2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World",
"service": "payment"
}
]
EOF
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND