<?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: Summarise XQL results by hostname in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/summarise-xql-results-by-hostname/m-p/569941#M5741</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/110844"&gt;@ianatgrafton&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can do that by using the comp stage with its count function (sometimes you will need to use count_distinct based on the use case you are trying to accomplish ) - Reference here -&amp;nbsp;&lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-XQL-Language-Reference/count" target="_blank"&gt;https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-XQL-Language-Reference/count&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;to your query above, you can write something like the below to count the actor images per hostname, and sort by the count in descending manner :&lt;BR /&gt;&lt;BR /&gt;dataset = xdr_data&lt;BR /&gt;| filter event_type = FILE and&lt;BR /&gt;actor_process_image_name contains ".exe" &lt;BR /&gt;| comp count(actor_process_image_name ) as Image_count by agent_hostname , actor_process_image_name &lt;BR /&gt;| sort desc Image_count&lt;BR /&gt;&lt;BR /&gt;Hope that was helpful and shed some light, please feel free to accept this as a solution if it answers your question so others can benefit from.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Z&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 18:21:23 GMT</pubDate>
    <dc:creator>zarnous</dc:creator>
    <dc:date>2023-12-14T18:21:23Z</dc:date>
    <item>
      <title>Summarise XQL results by hostname</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/summarise-xql-results-by-hostname/m-p/569930#M5739</link>
      <description>&lt;P&gt;Is it possible to group\count\summarise results from an XQL query by hostname rather than seeing every entry for every event?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example:&lt;/P&gt;
&lt;P&gt;dataset = xdr_data&lt;BR /&gt;| filter event_type = FILE and&lt;BR /&gt;actor_process_image_name contains "Something"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there someway I can just summarise or count the number of events per hostname rather than output every event that has the file "something" in it?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 17:10:09 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/summarise-xql-results-by-hostname/m-p/569930#M5739</guid>
      <dc:creator>ianatgrafton</dc:creator>
      <dc:date>2023-12-14T17:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Summarise XQL results by hostname</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/summarise-xql-results-by-hostname/m-p/569941#M5741</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/110844"&gt;@ianatgrafton&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can do that by using the comp stage with its count function (sometimes you will need to use count_distinct based on the use case you are trying to accomplish ) - Reference here -&amp;nbsp;&lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-XQL-Language-Reference/count" target="_blank"&gt;https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-XQL-Language-Reference/count&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;to your query above, you can write something like the below to count the actor images per hostname, and sort by the count in descending manner :&lt;BR /&gt;&lt;BR /&gt;dataset = xdr_data&lt;BR /&gt;| filter event_type = FILE and&lt;BR /&gt;actor_process_image_name contains ".exe" &lt;BR /&gt;| comp count(actor_process_image_name ) as Image_count by agent_hostname , actor_process_image_name &lt;BR /&gt;| sort desc Image_count&lt;BR /&gt;&lt;BR /&gt;Hope that was helpful and shed some light, please feel free to accept this as a solution if it answers your question so others can benefit from.&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Z&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 18:21:23 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/summarise-xql-results-by-hostname/m-p/569941#M5741</guid>
      <dc:creator>zarnous</dc:creator>
      <dc:date>2023-12-14T18:21:23Z</dc:date>
    </item>
  </channel>
</rss>

