<?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 Query: Issue with arrayindexof() function in host_inventory dataset in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-issue-with-arrayindexof-function-in-host-inventory/m-p/532197#M3703</link>
    <description>&lt;P&gt;I have also tried that in a built in field in the&amp;nbsp;host_inventory&amp;nbsp; dataset and still return an error,&amp;nbsp; hence, i recommend having a TAC case created so we get a better look at the backend and dataset configuration.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2023 17:10:44 GMT</pubDate>
    <dc:creator>zarnous</dc:creator>
    <dc:date>2023-02-24T17:10:44Z</dc:date>
    <item>
      <title>XQL Query: Issue with arrayindexof() function in host_inventory dataset</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-issue-with-arrayindexof-function-in-host-inventory/m-p/532046#M3693</link>
      <description>&lt;P&gt;Whenever we use arrayindexof() function with host_inventory dataset we get an error (Failed to run) but whereas when we run with dataset of xdr_data we get a success response message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please run the below XQL query: (Status == Success)&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;config case_sensitive = false
| dataset = xdr_data 
| alter sampleArray = arraycreate("ABC","DEF","GHI","JKL","MNO", "123")
| alter arrayLength = array_length(sampleArray)
| alter indexValue = arrayindexof(sampleArray,"@element" = "MNO")
| fields sampleArray, arrayLength, indexValue
| limit 10&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, run the below XQL query to produce the issue: (Status == Failed)&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;config case_sensitive = false
| dataset = host_inventory 
| alter sampleArray = arraycreate("ABC","DEF","GHI","JKL","MNO", "123")
| alter arrayLength = array_length(sampleArray)
| alter indexValue = arrayindexof(sampleArray,"@element" = "MNO") //If you comment this line the query runs absolutely fine.
| fields sampleArray, arrayLength, indexValue
| limit 10&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can we please have this fixed in host_inventory dataset, we would need this in order to loop through some data inside services json array in host_inventory dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-PRODUCT title="Cortex XDR" id="Cortex_XDR"&gt;&lt;/LI-PRODUCT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 00:25:34 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-issue-with-arrayindexof-function-in-host-inventory/m-p/532046#M3693</guid>
      <dc:creator>KanwarSingh01</dc:creator>
      <dc:date>2023-02-23T00:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: XQL Query: Issue with arrayindexof() function in host_inventory dataset</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-issue-with-arrayindexof-function-in-host-inventory/m-p/532197#M3703</link>
      <description>&lt;P&gt;I have also tried that in a built in field in the&amp;nbsp;host_inventory&amp;nbsp; dataset and still return an error,&amp;nbsp; hence, i recommend having a TAC case created so we get a better look at the backend and dataset configuration.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 17:10:44 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-issue-with-arrayindexof-function-in-host-inventory/m-p/532197#M3703</guid>
      <dc:creator>zarnous</dc:creator>
      <dc:date>2023-02-24T17:10:44Z</dc:date>
    </item>
  </channel>
</rss>

