<?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: How can I query and find records which have an empty array? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430981#M75427</link>
    <description>&lt;P&gt;Does courses show up as a field in those events? If not, you can use &lt;CODE&gt;| where isnull(courses)&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 17:56:04 GMT</pubDate>
    <dc:creator>nrduren1115</dc:creator>
    <dc:date>2018-10-19T17:56:04Z</dc:date>
    <item>
      <title>How can I query and find records which have an empty array?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430980#M75426</link>
      <description>&lt;P&gt;My JSON looks like this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
"id":"studentNumber",
"courses" : [ {
"course" : "Analysis of Alg"
},
{
"course": "game dev"
}

]

}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to get all the student numbers who haven't registered for any courses --&amp;gt; where "courses" array is empty.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 15:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430980#M75426</guid>
      <dc:creator>dreddy123</dc:creator>
      <dc:date>2018-10-19T15:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I query and find records which have an empty array?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430981#M75427</link>
      <description>&lt;P&gt;Does courses show up as a field in those events? If not, you can use &lt;CODE&gt;| where isnull(courses)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 17:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430981#M75427</guid>
      <dc:creator>nrduren1115</dc:creator>
      <dc:date>2018-10-19T17:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I query and find records which have an empty array?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430982#M75428</link>
      <description>&lt;P&gt;{&lt;BR /&gt;
 "id":"studentNumber",&lt;BR /&gt;
 "courses" : [ ]&lt;BR /&gt;
 }&lt;BR /&gt;
it will show up like this when no courses are registered.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:48:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430982#M75428</guid>
      <dc:creator>dreddy123</dc:creator>
      <dc:date>2018-10-19T18:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I query and find records which have an empty array?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430983#M75429</link>
      <description>&lt;P&gt;To be a bit more specific, is courses extracted as a field and if so, what is the value?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 18:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430983#M75429</guid>
      <dc:creator>nrduren1115</dc:creator>
      <dc:date>2018-10-19T18:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I query and find records which have an empty array?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430984#M75430</link>
      <description>&lt;P&gt;@ dreddy123&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH  | rename courses{}.course as courses_course | where isnull(courses_course) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My Sample Search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="{\"id\":\"studentNumber\",\"courses\":[{\"course\" : \"Analysis of Alg\"},{\"course\": \"game dev\"}]}" | append [ | makeresults | eval _raw="{\"id\":\"studentNumber\",\"courses\":[]}" ] |kv | rename courses{}.course as courses_course | where isnull(courses_course)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 17:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-query-and-find-records-which-have-an-empty-array/m-p/430984#M75430</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-10-21T17:02:05Z</dc:date>
    </item>
  </channel>
</rss>

