<?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 XQL query to find endpoints where X application is installed but not Y application in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517357#M2991</link>
    <description>&lt;P&gt;Im needing to find endpoints that have a certain application (Application1) installed but then does not have (Application2) installed&lt;/P&gt;
&lt;P&gt;The query below returns results that have either Application1 or Application2&lt;/P&gt;
&lt;P&gt;Im downloading the results and then using excel to find non duplicates, any way for xql to give me the results i need?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;config case_sensitive = false timeframe=1d &lt;BR /&gt;| dataset = host_inventory &lt;BR /&gt;| filter applications != null&lt;BR /&gt;| arrayexpand applications&lt;BR /&gt;| alter applicationname=json_extract(applications, "$.application_name")&lt;BR /&gt;| alter applicationversion=json_extract(applications, "$.version")&lt;BR /&gt;| alter appvendor=json_extract(applications, "$.vendor")&lt;BR /&gt;| alter installdate=json_extract(applications, "$.install_date")&lt;BR /&gt;| filter applicationname contains "Application1" or applicationname contains "Application2"&lt;BR /&gt;| fields host_name, applicationname, applicationversion, appvendor, installdate, system_type, product_type, ip_addresses&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 20:10:39 GMT</pubDate>
    <dc:creator>NathanBradley</dc:creator>
    <dc:date>2022-10-10T20:10:39Z</dc:date>
    <item>
      <title>XQL query to find endpoints where X application is installed but not Y application</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517357#M2991</link>
      <description>&lt;P&gt;Im needing to find endpoints that have a certain application (Application1) installed but then does not have (Application2) installed&lt;/P&gt;
&lt;P&gt;The query below returns results that have either Application1 or Application2&lt;/P&gt;
&lt;P&gt;Im downloading the results and then using excel to find non duplicates, any way for xql to give me the results i need?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;config case_sensitive = false timeframe=1d &lt;BR /&gt;| dataset = host_inventory &lt;BR /&gt;| filter applications != null&lt;BR /&gt;| arrayexpand applications&lt;BR /&gt;| alter applicationname=json_extract(applications, "$.application_name")&lt;BR /&gt;| alter applicationversion=json_extract(applications, "$.version")&lt;BR /&gt;| alter appvendor=json_extract(applications, "$.vendor")&lt;BR /&gt;| alter installdate=json_extract(applications, "$.install_date")&lt;BR /&gt;| filter applicationname contains "Application1" or applicationname contains "Application2"&lt;BR /&gt;| fields host_name, applicationname, applicationversion, appvendor, installdate, system_type, product_type, ip_addresses&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 20:10:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517357#M2991</guid>
      <dc:creator>NathanBradley</dc:creator>
      <dc:date>2022-10-10T20:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: XQL query to find endpoints where X application is installed but not Y application</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517397#M2996</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@NathanBradle, now that's a tricky one!&lt;BR /&gt;See if this helps:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;dataset = host_inventory
| filter applications != null
| arrayexpand applications
| alter applicationname=json_extract(applications, "$.application_name")
| alter applicationversion=json_extract(applications, "$.version")
| alter appvendor=json_extract(applications, "$.vendor")
| alter installdate=json_extract(applications, "$.install_date")
| alter applicationNameCount = "0" // create a new column called 'applicationnameC
| alter applicationNameCount  = if (applicationname contains "Chrome", replace (applicationNameCount, "0" , "1" ), applicationNameCount ) // if application 1 is installed
| alter applicationNameCount  = if (applicationname contains "Firefox", replace (applicationNameCount, "0", "2"), applicationNameCount ) // if application 2 is installed
| comp sum (to_integer(applicationNameCount)) as appInstalled by host_name 
| filter appInstalled = 1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 05:48:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517397#M2996</guid>
      <dc:creator>bbarmanroy</dc:creator>
      <dc:date>2022-10-11T05:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: XQL query to find endpoints where X application is installed but not Y application</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517459#M3001</link>
      <description>&lt;P&gt;Thanks a ton I would not have gotten there, i was spot checking results at least 1 endpoint it didnt get&lt;/P&gt;
&lt;P&gt;The endpoint below does have App1 but does not have App2&lt;/P&gt;
&lt;P&gt;Could it be because the query got host_inventory data from 2 days, so there are 2 instances of App1 listed&lt;/P&gt;
&lt;P&gt;Im not entirely sure what the last 2 lines of your query do though&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="NathanBradley_0-1665495995108.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/44571i1AD7293A3B366346/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="NathanBradley_0-1665495995108.png" alt="NathanBradley_0-1665495995108.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 13:48:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-to-find-endpoints-where-x-application-is-installed-but/m-p/517459#M3001</guid>
      <dc:creator>NathanBradley</dc:creator>
      <dc:date>2022-10-11T13:48:03Z</dc:date>
    </item>
  </channel>
</rss>

