<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hostname for Process restart event in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/231607#M419</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks for your suggestion and I was taking few days off from my work so took some time to answer .&lt;BR /&gt;&lt;BR /&gt;The query itself seems to work but it just takes a quite a lot of time on our environment and if I try to pull data from the past 7 days it shoots the following error after a while.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The lookup command's subquery read too much data. Please continue to filter the lookup table or narrow the query time range.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;But thanks for pointing it out how to utilize the lookup and now just need to find some way to make the query more lightweight.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2023 14:09:55 GMT</pubDate>
    <dc:creator>janne_olkoniemi</dc:creator>
    <dc:date>2023-12-12T14:09:55Z</dc:date>
    <item>
      <title>Hostname for Process restart event</title>
      <link>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/230509#M403</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I'm relativity new with DQL and taking my first baby steps with it currently and trying to figure out how to utilize it.&lt;BR /&gt;One us case I have currently is to list certain process restarts for table and facing some challenges how to include the hostname on my query where the restart has happened?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I would be&amp;nbsp;greatly appreciated if someone could help me on this since since not sure which way I should&amp;nbsp;approach this challenge.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;fetch events&lt;BR /&gt;| fieldsAdd dt.entity.host.name, dt.entity.process_group_instance.name, displayName, timestamp&lt;BR /&gt;| filter event.group_label == "Process restart" and dt.entity.process_group_instance.name == "WebSphere Liberty runtime"&lt;BR /&gt;| fields dt.entity.process_group_instance.name, timestamp, dt.entity.host.name&lt;BR /&gt;| sort timestamp desc&lt;BR /&gt;| limit 10&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 09:05:45 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/230509#M403</guid>
      <dc:creator>janne_olkoniemi</dc:creator>
      <dc:date>2023-12-01T09:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Hostname for Process restart event</title>
      <link>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/230866#M405</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/23527"&gt;@janne_olkoniemi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you looking for this query?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events
| filter event.kind == "DAVIS_EVENT" and event.type == "PROCESS_RESTART"
| lookup [
  fetch dt.entity.process_group_instance
  | fieldsAdd host = belongs_to[dt.entity.host]
  | fieldsAdd host.name = lookup([fetch dt.entity.host | fields id, entity.name, osArchitecture], sourceField:host, lookupField:id)[entity.name]
], sourceField:dt.entity.process_group_instance, lookupField:id,fields: { host.name }
| fields  timestamp, dt.entity.process_group_instance.name,host.name&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Best,&lt;BR /&gt;Sini&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 08:25:37 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/230866#M405</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-12-05T08:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Hostname for Process restart event</title>
      <link>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/231607#M419</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/38283"&gt;@sinisa_zubic&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thanks for your suggestion and I was taking few days off from my work so took some time to answer .&lt;BR /&gt;&lt;BR /&gt;The query itself seems to work but it just takes a quite a lot of time on our environment and if I try to pull data from the past 7 days it shoots the following error after a while.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The lookup command's subquery read too much data. Please continue to filter the lookup table or narrow the query time range.&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;But thanks for pointing it out how to utilize the lookup and now just need to find some way to make the query more lightweight.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 14:09:55 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/231607#M419</guid>
      <dc:creator>janne_olkoniemi</dc:creator>
      <dc:date>2023-12-12T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hostname for Process restart event</title>
      <link>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/231894#M425</link>
      <description>&lt;P&gt;I have tried to optimize the query and instead of lookup and I am using now join and append. Can you try this query out?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;fetch events, scanLimitGBytes:-1
| fieldsAdd dt.system.bucket
| filter event.kind == "DAVIS_EVENT" and event.type == "PROCESS_RESTART"
| fieldsAdd dt.entity.process_group_instance = arrayFirst(affected_entity_ids)
| JOIN [
  fetch dt.entity.process_group_instance
  | fields dt.entity.host = belongs_to[dt.entity.host], dt.entity.process_group_instance = id
  | append[
    fetch dt.entity.host
    | fields dt.entity.host = id, hostname = entity.name
  ]
  | summarize {hostname = takeAny(hostname), dt.entity.process_group_instance = takeAny(dt.entity.process_group_instance)}, by:{dt.entity.host}
], on:{dt.entity.process_group_instance}, 
  fields:{
    hostname
  }
| fields  timestamp, dt.entity.process_group_instance.name,hostname&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 12:08:24 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/Hostname-for-Process-restart-event/m-p/231894#M425</guid>
      <dc:creator>sinisa_zubic</dc:creator>
      <dc:date>2023-12-14T12:08:24Z</dc:date>
    </item>
  </channel>
</rss>

