🚀 DevOps & SRE Certification Program 📅 Starting: 1st of Every Month 🤝 +91 8409492687 🔍 Contact@DevOpsSchool.com

Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Get and Post Datadog Events using Datadog API

The events service allows you to programmatically post events to the event stream and fetch events from the event stream. Events are limited to 4000 characters. If an event is sent out with a message containing more than 4000 characters only the 4000 first characters are displayed.

This endpoint allows you to post events to the stream. Tag them, set priority and event aggregate them with other events.

# Post an event returns "OK" response
# Curl command
curl -X POST "https://api.us5.datadoghq.com/api/v1/events" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"title": "Example-Post_an_event_returns_OK_response",
"text": "A text message.",
"tags": [
"test:ExamplePostaneventreturnsOKresponse"
]
}
EOF
# Post an Event with a long title returns "OK" response
# Curl command
curl -X POST "https://api.us5.datadoghq.com/api/v1/events" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-d @- << EOF
{
"title": "Example-Post_an_event_with_a_long_title_returns_OK_response very very very looooooooong looooooooooooong loooooooooooooooooooooong looooooooooooooooooooooooooong title with 100+ characters",
"text": "A text message.",
"tags": [
"test:ExamplePostaneventwithalongtitlereturnsOKresponse"
]
}
EOF
# Example
# Curl command
curl -X POST "https://api.us5.datadoghq.com/api/v1/events" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: 061585f627bb034f27fc6dddddddddddd" \
-d @- << EOF
{
"title": "Example-Post_an_event_returns_OK_response",
"text": "A text message.",
"tags": [
"test:ExamplePostaneventreturnsOKresponse"
]
}
EOF
# GET an Event
# Required query arguments
export start="CHANGE_ME"
export end="CHANGE_ME"
# Curl command
curl -X GET "https://api.us5.datadoghq.com/api/v1/events?start=${start}&end=${end}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
export event_id="65792150446608ddddddd"
# Curl command
curl -X GET "https://api.us5.datadoghq.com/api/v1/events/${event_id}" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: 061585f627bb034f27fcdddddddddddb" \
-H "DD-APPLICATION-KEY: 7f5ef337e8383473d46efe602e7ddddddddddd"
Subscribe
Notify of
guest


0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

0
Would love your thoughts, please comment.x
()
x