<?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: Need help to create XQL Queries in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/need-help-to-create-xql-queries/m-p/540569#M4257</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/239161"&gt;@VenuK&lt;/a&gt;, thank you for writing to Live Community.&lt;BR /&gt;&lt;BR /&gt;1. I am not sure what do you mean by agent malfunction, but if you are referring to agent disconnected/lost connection you can use the following query as baseline:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = endpoints | filter endpoint_status = CONNECTION_LOST or endpoint_status = DISCONNECTED&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;2. For agents with no content update please try the below query:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = endpoints 
| filter content_version = "" and (endpoint_status = CONNECTED or endpoint_status = DISCONNECTED)
| alter last_seen_diff = timestamp_diff(current_time(), last_seen, "DAY") 
| filter last_seen_diff &amp;lt;= 7
| comp count(endpoint_id ) as count
| view graph type = pie show_percentage = `false` xaxis = count yaxis = count default_limit = `false` legend = `false` &lt;/LI-CODE&gt;
&lt;P&gt;3. Regarding agents being partially protected or unprotected please try the below query as baseline (feel free to choose which fields you'd like to see in the table):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = endpoints 
| filter operational_status != ENUM.PROTECTED 
| fields Endpoint_Name as Name, operational_status, is_edr_enabled, operating_system as OS, os_version, kernel_version, mac_address, agent_version as Cortex_Agent_Version, ip_address as IP, endpoint_type
| view graph type = pie &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;4. Regarding agent connection issues please see the first query I suggested.&lt;BR /&gt;&lt;BR /&gt;Hope these will help you get started with the queries you're looking to build.&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 01:12:26 GMT</pubDate>
    <dc:creator>mavraham</dc:creator>
    <dc:date>2023-05-01T01:12:26Z</dc:date>
    <item>
      <title>Need help to create XQL Queries</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/need-help-to-create-xql-queries/m-p/540416#M4242</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need your help and advise to acheive the below requirement in XQL query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Agent malfunction/ no content updates/ no upgrade &lt;BR /&gt;2. Agent partially protected/memory storage/junk storage &lt;BR /&gt;3. Network malfunction, not able to connect back.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in Advance,&lt;/P&gt;
&lt;P&gt;Venu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 04:09:50 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/need-help-to-create-xql-queries/m-p/540416#M4242</guid>
      <dc:creator>VenuK</dc:creator>
      <dc:date>2023-04-28T04:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to create XQL Queries</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/need-help-to-create-xql-queries/m-p/540569#M4257</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/239161"&gt;@VenuK&lt;/a&gt;, thank you for writing to Live Community.&lt;BR /&gt;&lt;BR /&gt;1. I am not sure what do you mean by agent malfunction, but if you are referring to agent disconnected/lost connection you can use the following query as baseline:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = endpoints | filter endpoint_status = CONNECTION_LOST or endpoint_status = DISCONNECTED&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;2. For agents with no content update please try the below query:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = endpoints 
| filter content_version = "" and (endpoint_status = CONNECTED or endpoint_status = DISCONNECTED)
| alter last_seen_diff = timestamp_diff(current_time(), last_seen, "DAY") 
| filter last_seen_diff &amp;lt;= 7
| comp count(endpoint_id ) as count
| view graph type = pie show_percentage = `false` xaxis = count yaxis = count default_limit = `false` legend = `false` &lt;/LI-CODE&gt;
&lt;P&gt;3. Regarding agents being partially protected or unprotected please try the below query as baseline (feel free to choose which fields you'd like to see in the table):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = endpoints 
| filter operational_status != ENUM.PROTECTED 
| fields Endpoint_Name as Name, operational_status, is_edr_enabled, operating_system as OS, os_version, kernel_version, mac_address, agent_version as Cortex_Agent_Version, ip_address as IP, endpoint_type
| view graph type = pie &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;4. Regarding agent connection issues please see the first query I suggested.&lt;BR /&gt;&lt;BR /&gt;Hope these will help you get started with the queries you're looking to build.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 01:12:26 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/need-help-to-create-xql-queries/m-p/540569#M4257</guid>
      <dc:creator>mavraham</dc:creator>
      <dc:date>2023-05-01T01:12:26Z</dc:date>
    </item>
  </channel>
</rss>

