# Events on particular to CSV

**URL:** <https://community.dynatrace.com/t/events-on-particular-to-csv/35735>\
**Category:** Open Q&A\
**Tags:** tagging, problems-classic, dynatrace-api\
**Created:** [July 5, 2022, 8:38am UTC](https://community.dynatrace.com/t/events-on-particular-to-csv/35735 "2022-07-05T08:38:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pranav1](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@Pranav1](https://community.dynatrace.com/u/Pranav1)\
**Post date:** [July 5, 2022, 8:38am UTC](https://community.dynatrace.com/t/events-on-particular-to-csv/35735/1 "2022-07-05T08:38:47Z")

</div>

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(“PROCESS\_RESTART”)&entitySelector=entityId("HOST-xxxxxxxxxxxx22)](https://xxxxxx.live.dynatrace.com/api/v2/events?from=-24h&to=now&eventSelector=eventType%28%22PROCESS%5C_RESTART%22%29&entitySelector=entityId%28%22HOST-xxxxxxxxxxxx22%29)&nbsp;" -H “accept: application/json; charset=utf-8” -H “Authorization: Api-Token dtxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [July 5, 2022, 10:59am UTC](https://community.dynatrace.com/t/events-on-particular-to-csv/35735/2 "2022-07-05T10:59:11Z")

</div>

Hi&nbsp;[@Pranav1](https://community.dynatrace.com/user/48767)

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&nbsp;process entity with v2/entities/{entityId}&nbsp; rest IP to check if its belong to the host

For example

 ![Yosi_Neuman_1-1657018743137.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/c/1c033dc44594f31608dd382a0b8425b37748a6e1.png)

 ![Yosi_Neuman_0-1657018662465.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/8de3c642626595e5da10d2bb6742e9ba0a1638a7.png)

HTH

Yos

---

<div class="post-metadata">

**Author:** ![techean](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/techean/32/227_2.png) [@techean](https://community.dynatrace.com/u/techean)\
**Post date:** [July 6, 2022, 12:35pm UTC](https://community.dynatrace.com/t/events-on-particular-to-csv/35735/3 "2022-07-06T12:35:57Z")

</div>

Here is the time to convert this into an Idea&nbsp;[@Pranav1](https://community.dynatrace.com/user/48767)
