<?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: XQL Stacked Graph in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/560138#M5238</link>
    <description>&lt;P&gt;Hi everybody,&lt;/P&gt;
&lt;P&gt;I found my case a little more complicated than expected.&lt;/P&gt;
&lt;P&gt;To be able to do a stacked graph with sum values of different DNS types for the same dns name, I need to get a table that looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DNS name | A count | NS Count | AAAA count | SRV count etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to create fields in alter stage dynamicaly but failed, so I was able to reach my goal with following Query, that seems to be over complicated. If any of you is able to simplify it or reach the same result easier way, it would be very appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;preset = network_story &lt;BR /&gt;| fields dns_query_name , dns_query_type&lt;BR /&gt;| comp count(dns_query_name) as PocetByType by dns_query_type , dns_query_name&lt;BR /&gt;| comp sum(PocetByType) as AbsolutSummary by dns_query_name &lt;BR /&gt;| join (preset = network_story &lt;BR /&gt;| fields dns_query_name , dns_query_type&lt;BR /&gt;| comp count(dns_query_name) as CountByDNSType by dns_query_type , dns_query_name)&lt;BR /&gt;as e e.dns_query_name = dns_query_name&lt;BR /&gt;| sort desc AbsolutSummary , desc CountByDNSType &lt;BR /&gt;| limit 100&lt;BR /&gt;| alter A_Type = if(dns_query_type = "A" , CountByDNSType , 0 )&lt;BR /&gt;| alter NS_Type = if(dns_query_type = "NS" , CountByDNSType , 0 )&lt;BR /&gt;| alter SOA_Type = if(dns_query_type = "SOA" , CountByDNSType , 0 )&lt;BR /&gt;| alter AAAA_Type = if(dns_query_type = "AAAA" , CountByDNSType , 0 )&lt;BR /&gt;| alter SRV_Type = if(dns_query_type = "SRV" , CountByDNSType , 0 )&lt;BR /&gt;| alter Unknown_Type = if(dns_query_type = "Unknown" , CountByDNSType , 0 )&lt;BR /&gt;| comp sum(A_Type) as A, sum(NS_Type) as NS, sum (SOA_Type) as SOA , sum (SRV_Type) as SRV , sum (Unknown_Type) as unknown by dns_query_name&lt;BR /&gt;| limit 15&lt;BR /&gt;| view graph type = column subtype = stacked show_callouts = `true` xaxis = dns_query_name yaxis = NS,SOA,SRV,unknown,A yaxminrange = 1 default_limit = `false`&lt;/P&gt;</description>
    <pubDate>Sun, 01 Oct 2023 16:06:36 GMT</pubDate>
    <dc:creator>Honza_Linhart</dc:creator>
    <dc:date>2023-10-01T16:06:36Z</dc:date>
    <item>
      <title>XQL Stacked Graph</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/558567#M5177</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;
&lt;P&gt;I need to create stacked graph similar to the one on Ingestion dashboard (Daily consumption).&lt;/P&gt;
&lt;P&gt;The graph should have DNS query name on X axis and total count on y axis. But at the same time, I need to have the column separated by DNS_query_type. I have a data in a table, but I'm not able to create a graph of this type, can you please help me?&lt;/P&gt;
&lt;P&gt;The graph should look like the one from ELK on the following picture.&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;Jan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Honza_Linhart_0-1695125769183.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/53839iF043AB030CEBFC4A/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="Honza_Linhart_0-1695125769183.png" alt="Honza_Linhart_0-1695125769183.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2023 12:20:09 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/558567#M5177</guid>
      <dc:creator>Honza_Linhart</dc:creator>
      <dc:date>2023-09-19T12:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Stacked Graph</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/558850#M5188</link>
      <description>&lt;P&gt;Hello Jan, thanks for reaching the Live Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll see if I can find some type of data like yours in my tentant, and try to help you building that graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JM&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 17:56:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/558850#M5188</guid>
      <dc:creator>jmazzeo</dc:creator>
      <dc:date>2023-09-20T17:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Stacked Graph</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/558944#M5189</link>
      <description>&lt;P&gt;That would be great, thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 07:22:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/558944#M5189</guid>
      <dc:creator>Honza_Linhart</dc:creator>
      <dc:date>2023-09-21T07:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Stacked Graph</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/559046#M5194</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/241246"&gt;@Honza_Linhart&lt;/a&gt;&amp;nbsp;, let me share this example that I worked, is not exactly the same, but maybe it helps.&lt;/P&gt;
&lt;P&gt;XQL Query:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dataset = xdr_data&lt;/P&gt;
&lt;P&gt;| filter agent_hostname = "AN_ENDPOINT"&lt;BR /&gt;| filter event_type = NETWORK &lt;BR /&gt;| fields action_upload as up, action_download as down, actor_process_image_name as process &lt;BR /&gt;| comp sum(up) as up, sum(down) as down by process&lt;BR /&gt;| limit 10&lt;BR /&gt;| view graph type = column subtype = &lt;STRONG&gt;stacked&lt;/STRONG&gt; xaxis = process &lt;STRONG&gt;yaxis = up,down&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, I have grouped the up/down traffic for each process in the same column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jmazzeo_0-1695320582385.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/53927i5D79E3744C5D6497/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="jmazzeo_0-1695320582385.png" alt="jmazzeo_0-1695320582385.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe saving the Query Types in an "alter" stage variable can work in the "yaxis" value of this stacked subtype graph type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2023 18:25:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/559046#M5194</guid>
      <dc:creator>jmazzeo</dc:creator>
      <dc:date>2023-09-21T18:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Stacked Graph</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/559641#M5220</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/241246"&gt;@Honza_Linhart&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may customize below XQL query or logic to meet your requirement. Based on below logic I have created a widget something similar/closer to the one you shared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PiyushKohli_0-1695812949428.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/54000iCA54FC83E3D9E699/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="PiyushKohli_0-1695812949428.png" alt="PiyushKohli_0-1695812949428.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;dataset = xdr_data &lt;BR /&gt;|filter event_type = ENUM.STORY and dns_query_name != NULL and dns_query_type != NULL&lt;BR /&gt;| fields dns_query_name , dns_query_type &lt;BR /&gt;| comp count(dns_query_name) as Total_dns_requests by dns_query_name , dns_query_type &lt;BR /&gt;| sort desc Total_dns_requests &lt;BR /&gt;| limit 15&lt;BR /&gt;|alter x_axis = concat(dns_query_name , " ", dns_query_type )&lt;BR /&gt;| view graph type = column subtype = stacked show_callouts = `true` xaxis = x_axis yaxis = Total_dns_requests&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;Please mark the response as "Accept as Solution" if it answers your query.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 11:11:29 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/559641#M5220</guid>
      <dc:creator>PiyushKohli</dc:creator>
      <dc:date>2023-09-27T11:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Stacked Graph</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/560138#M5238</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;
&lt;P&gt;I found my case a little more complicated than expected.&lt;/P&gt;
&lt;P&gt;To be able to do a stacked graph with sum values of different DNS types for the same dns name, I need to get a table that looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DNS name | A count | NS Count | AAAA count | SRV count etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to create fields in alter stage dynamicaly but failed, so I was able to reach my goal with following Query, that seems to be over complicated. If any of you is able to simplify it or reach the same result easier way, it would be very appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;preset = network_story &lt;BR /&gt;| fields dns_query_name , dns_query_type&lt;BR /&gt;| comp count(dns_query_name) as PocetByType by dns_query_type , dns_query_name&lt;BR /&gt;| comp sum(PocetByType) as AbsolutSummary by dns_query_name &lt;BR /&gt;| join (preset = network_story &lt;BR /&gt;| fields dns_query_name , dns_query_type&lt;BR /&gt;| comp count(dns_query_name) as CountByDNSType by dns_query_type , dns_query_name)&lt;BR /&gt;as e e.dns_query_name = dns_query_name&lt;BR /&gt;| sort desc AbsolutSummary , desc CountByDNSType &lt;BR /&gt;| limit 100&lt;BR /&gt;| alter A_Type = if(dns_query_type = "A" , CountByDNSType , 0 )&lt;BR /&gt;| alter NS_Type = if(dns_query_type = "NS" , CountByDNSType , 0 )&lt;BR /&gt;| alter SOA_Type = if(dns_query_type = "SOA" , CountByDNSType , 0 )&lt;BR /&gt;| alter AAAA_Type = if(dns_query_type = "AAAA" , CountByDNSType , 0 )&lt;BR /&gt;| alter SRV_Type = if(dns_query_type = "SRV" , CountByDNSType , 0 )&lt;BR /&gt;| alter Unknown_Type = if(dns_query_type = "Unknown" , CountByDNSType , 0 )&lt;BR /&gt;| comp sum(A_Type) as A, sum(NS_Type) as NS, sum (SOA_Type) as SOA , sum (SRV_Type) as SRV , sum (Unknown_Type) as unknown by dns_query_name&lt;BR /&gt;| limit 15&lt;BR /&gt;| view graph type = column subtype = stacked show_callouts = `true` xaxis = dns_query_name yaxis = NS,SOA,SRV,unknown,A yaxminrange = 1 default_limit = `false`&lt;/P&gt;</description>
      <pubDate>Sun, 01 Oct 2023 16:06:36 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-stacked-graph/m-p/560138#M5238</guid>
      <dc:creator>Honza_Linhart</dc:creator>
      <dc:date>2023-10-01T16:06:36Z</dc:date>
    </item>
  </channel>
</rss>

