05 Jul 2022 09:38 AM - last edited on 01 Sep 2022 12:22 PM by MaciejNeumann
We have a requirement to retrieve all the events on a particular host into a sheet(excel/CSV).
I tried using Event API-2 to get the event, but the output I am receiving is for all the hosts, when tried using Entity selector with HostId, then we are getting no response body.
I am using the below API call,
curl -X GET "https://xxxxxx.live.dynatrace.com/api/v2/events?from=-24h&to=now&eventSelector=eventType%28%22PROCESS_RESTART%22%29&entitySelector=entityId%28%22HOST-xxxxxxxxxxxx22%29 " -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token dtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Solved! Go to Solution.
05 Jul 2022 11:59 AM
Hi @Pranav1
Since you are looking for process restarts the information you are getting back are not including the host id or name.
So for each entry in the response you will need to check the process entity with v2/entities/{entityId} rest IP to check if its belong to the host
For example
HTH
Yos
06 Jul 2022 01:35 PM
Here is the time to convert this into an Idea @Pranav1