<?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 to filter a JSON data log when one of the fields in that JSON is empty? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432195#M123487</link>
    <description>&lt;P&gt;Also, I am using splunk web so don't know how to turn json extraction on.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 18:29:34 GMT</pubDate>
    <dc:creator>mayurk90</dc:creator>
    <dc:date>2019-06-17T18:29:34Z</dc:date>
    <item>
      <title>How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432192#M123484</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to filter the log event based on a json field which is empty. I have 3 million records and out of which 2 are having those field empty which I am trying to extract log for.&lt;/P&gt;

&lt;P&gt;The json looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; "third": [
    {
      "ad": {
        "dd": "aaa",
        "value": "",                           &amp;lt;-----------this is the field which I want to search on when its empty
        "version": 1,
        "do": "bbb"
      },
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So in this case how to search that kind of log?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432192#M123484</guid>
      <dc:creator>mayurk90</dc:creator>
      <dc:date>2019-06-17T14:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432193#M123485</link>
      <description>&lt;P&gt;Assuming you already have json extraction working in general. Something like this should work (I believe the field will be missing when there is no value for it in the json):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="foo" sourcetype="bar" NOT third.ad.value=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So basically just search for &lt;CODE&gt;NOT &amp;lt;fieldname&amp;gt;!=*&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Unless the automatic json extraction actually does extract that event with a value of empty string, then you could search for it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="foo" sourcetype="bar" third.ad.value=""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jun 2019 17:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432193#M123485</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-17T17:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432194#M123486</link>
      <description>&lt;P&gt;My logs are In Json only but I don't understand how to activate json extraction?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432194#M123486</guid>
      <dc:creator>mayurk90</dc:creator>
      <dc:date>2019-06-17T18:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432195#M123487</link>
      <description>&lt;P&gt;Also, I am using splunk web so don't know how to turn json extraction on.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432195#M123487</guid>
      <dc:creator>mayurk90</dc:creator>
      <dc:date>2019-06-17T18:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432196#M123488</link>
      <description>&lt;P&gt;I was going through some more details since I am new on splunk and my datasource shows as logstash.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 19:35:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432196#M123488</guid>
      <dc:creator>mayurk90</dc:creator>
      <dc:date>2019-06-17T19:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432197#M123489</link>
      <description>&lt;P&gt;Automatic JSON extractions should be enabled by default, but perhaps the specific sourcetype you assigned (or splunk chose to assign) has it disabled for some reason.&lt;/P&gt;

&lt;P&gt;Can you provide some more details on how you got this data into splunk and perhaps some relevant screenshots showing the data, sourcetype value, which fields get extracted and such?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 06:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432197#M123489</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-18T06:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432198#M123490</link>
      <description>&lt;P&gt;Basically my data is in the format like below: &lt;/P&gt;

&lt;P&gt;@timestamp: 2019-06-19T12:32:23.591Z&lt;BR /&gt;&lt;BR /&gt;
@version: 1&lt;BR /&gt;&lt;BR /&gt;
app_id: 90333&lt;BR /&gt;&lt;BR /&gt;
host: fgfjfjfj00053141.server.net&lt;BR /&gt;
message: 2019-06-19 08:32:23,373 INFO  [AMPS Java Client Background Reader Thread ***] "third": [&lt;BR /&gt;
     {&lt;BR /&gt;
     "ad": {&lt;BR /&gt;
      "dd": "aaa",&lt;BR /&gt;
        "value": "",                           &amp;lt;-----------this is the field which I want to search on when its empty&lt;BR /&gt;
        "version": 1,&lt;BR /&gt;
        "do": "bbb"&lt;BR /&gt;
       }]&lt;BR /&gt;
app_id =    90333       host =  fgfjfjfj00053141.server.net     host =hdhdhdhd.net&lt;BR /&gt;&lt;BR /&gt;
source =    /apps/uat01/logs/abc-logger.log&lt;BR /&gt;&lt;BR /&gt;
sourcetype =    logstash        &lt;/P&gt;

&lt;P&gt;So the json data is part of value field of message key field and from there I want to check if the field is empty then show me those events having empty field.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:00:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432198#M123490</guid>
      <dc:creator>mayurk90</dc:creator>
      <dc:date>2020-09-30T01:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432199#M123491</link>
      <description>&lt;P&gt;Ok, so the event is not fully json. Which means automatic json extractions won't work.&lt;/P&gt;

&lt;P&gt;Did you do any field extraction for that field yet? Or do you at the moment only have a raw event in splunk?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 13:32:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432199#M123491</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-19T13:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432200#M123492</link>
      <description>&lt;P&gt;I just have raw event in splunk for now&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 17:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432200#M123492</guid>
      <dc:creator>mayurk90</dc:creator>
      <dc:date>2019-06-19T17:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter a JSON data log when one of the fields in that JSON is empty?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432201#M123493</link>
      <description>&lt;P&gt;Then just add &lt;CODE&gt;"\"value\": \"\""&lt;/CODE&gt; to your search query.&lt;/P&gt;

&lt;P&gt;So for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="foo" sourcetype="bar" "\"value\": \"\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2019 17:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-a-JSON-data-log-when-one-of-the-fields-in-that/m-p/432201#M123493</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-19T17:32:51Z</dc:date>
    </item>
  </channel>
</rss>

