<?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: query to check is a list is [] or has values in it in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386129#M112729</link>
    <description>&lt;P&gt;@wajeeh911 &lt;/P&gt;

&lt;P&gt;In this case I suggest you to take benefit of any child field of &lt;CODE&gt;failureRadar&lt;/CODE&gt;. Like, in my below sample example I have took &lt;CODE&gt;A&lt;/CODE&gt; as child field of  &lt;CODE&gt;failureRadar&lt;/CODE&gt;. After renaming this field we can use it with &lt;CODE&gt;where isnull(&lt;/CODE&gt; ( As @niketnilay said)  to get &lt;CODE&gt;failureRadar&lt;/CODE&gt; empty events. Please check my below &lt;STRONG&gt;Sample Search&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Events used:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;{ "other_keys":"HI", "failureRadar":[]}&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;{ "other_keys":"HI", "failureRadar":[{"A":"B"}]}&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Sample Search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{ \"other_keys\":\"HI\", \"failureRadar\":[]}" | append [ | makeresults | eval _raw="{ \"other_keys\":\"HI\", \"failureRadar\":[{\"A\":\"B\"}]}" ] | kv
|rename failureRadar{}.A as myFlag
| where isnull(myFlag)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try below search ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH  |rename failureRadar{}.A as myFlag
| where isnull(myFlag)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; &lt;CODE&gt;A&lt;/CODE&gt; is my child field of &lt;CODE&gt;failureRadar&lt;/CODE&gt;. replace it with your original fields.&lt;/P&gt;

&lt;P&gt;Try and let us know if any challenges. Please share some sample events for us to further assistance. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2019 05:32:59 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-07-12T05:32:59Z</dc:date>
    <item>
      <title>query to check is a list is [] or has values in it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386124#M112724</link>
      <description>&lt;P&gt;I'm having trouble querying the field attached in the image. I either want to know is its empty or has values in it. Does anyone know the proper syntax?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7320i67F1AF5745738BF7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 22:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386124#M112724</guid>
      <dc:creator>wajeeh911</dc:creator>
      <dc:date>2019-07-11T22:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: query to check is a list is [] or has values in it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386125#M112725</link>
      <description>&lt;P&gt;can you just table the field and post the results so we can see what is there currently?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| table failureRadar&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2019 22:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386125#M112725</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2019-07-11T22:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: query to check is a list is [] or has values in it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386126#M112726</link>
      <description>&lt;P&gt;@marycordova I'm not looking to table the results, I'm trying to query results only when the list is empty.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 04:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386126#M112726</guid>
      <dc:creator>wajeeh911</dc:creator>
      <dc:date>2019-07-12T04:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: query to check is a list is [] or has values in it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386127#M112727</link>
      <description>&lt;P&gt;@wajeeh911 what is your current query? Can you post sample JSON (raw) for the two scenarios?&lt;BR /&gt;
Have you tried the following filter?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where isnull(failureRadar)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Jul 2019 04:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386127#M112727</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-07-12T04:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: query to check is a list is [] or has values in it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386128#M112728</link>
      <description>&lt;P&gt;Right but a table will let me see what your data looks like so I can help you&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 05:03:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386128#M112728</guid>
      <dc:creator>marycordova</dc:creator>
      <dc:date>2019-07-12T05:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: query to check is a list is [] or has values in it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386129#M112729</link>
      <description>&lt;P&gt;@wajeeh911 &lt;/P&gt;

&lt;P&gt;In this case I suggest you to take benefit of any child field of &lt;CODE&gt;failureRadar&lt;/CODE&gt;. Like, in my below sample example I have took &lt;CODE&gt;A&lt;/CODE&gt; as child field of  &lt;CODE&gt;failureRadar&lt;/CODE&gt;. After renaming this field we can use it with &lt;CODE&gt;where isnull(&lt;/CODE&gt; ( As @niketnilay said)  to get &lt;CODE&gt;failureRadar&lt;/CODE&gt; empty events. Please check my below &lt;STRONG&gt;Sample Search&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Events used:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;{ "other_keys":"HI", "failureRadar":[]}&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;{ "other_keys":"HI", "failureRadar":[{"A":"B"}]}&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Sample Search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{ \"other_keys\":\"HI\", \"failureRadar\":[]}" | append [ | makeresults | eval _raw="{ \"other_keys\":\"HI\", \"failureRadar\":[{\"A\":\"B\"}]}" ] | kv
|rename failureRadar{}.A as myFlag
| where isnull(myFlag)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can you please try below search ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH  |rename failureRadar{}.A as myFlag
| where isnull(myFlag)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; &lt;CODE&gt;A&lt;/CODE&gt; is my child field of &lt;CODE&gt;failureRadar&lt;/CODE&gt;. replace it with your original fields.&lt;/P&gt;

&lt;P&gt;Try and let us know if any challenges. Please share some sample events for us to further assistance. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2019 05:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-to-check-is-a-list-is-or-has-values-in-it/m-p/386129#M112729</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-07-12T05:32:59Z</dc:date>
    </item>
  </channel>
</rss>

