<?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 search specific object value of json data in spunk? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299525#M56660</link>
    <description>&lt;P&gt;You can also try &lt;CODE&gt;search&lt;/CODE&gt; command instead of final &lt;CODE&gt;where&lt;/CODE&gt; pipe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;YourBaseSearch&amp;gt;
|  rex "(?ms)\"ABC\": \[(?&amp;lt;jsonData&amp;gt;[^\]]+\])"
|  spath input=jsonData
| search C=987654321 AND E=*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Nov 2017 09:13:53 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-11-21T09:13:53Z</dc:date>
    <item>
      <title>How can I search specific object value of json data in spunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299523#M56658</link>
      <description>&lt;P&gt;How can I search for results where value of C is 987654321 and E is null from the below sample.&lt;/P&gt;

&lt;P&gt;CLASS=Test MTD=getMethod LN=10 :  METRICS_JSON_NODE=&lt;BR /&gt;
    "ABC": [&lt;BR /&gt;
        {&lt;BR /&gt;
            "A": "abc",&lt;BR /&gt;
            "B": "c1b1a1",&lt;BR /&gt;
            "C": 987654321,&lt;BR /&gt;
            "D": 123,&lt;BR /&gt;
            "E": 123456789,&lt;BR /&gt;
            "F": false,&lt;BR /&gt;
            "G": "bcfaff1d50025094089f5a02d0dbd00e568d7dbe"&lt;BR /&gt;
        }&lt;BR /&gt;
    ]&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299523#M56658</guid>
      <dc:creator>chaithanyaSplun</dc:creator>
      <dc:date>2020-09-29T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search specific object value of json data in spunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299524#M56659</link>
      <description>&lt;P&gt;@chaithanyaSplunk, try the following run anywhere search based on sample data provided. You need to put in your base search instead of first two pipes i.e. &lt;CODE&gt;| makeresults&lt;/CODE&gt; and &lt;CODE&gt;| eval _raw ...&lt;/CODE&gt;, which are used to generate mock data.&lt;/P&gt;

&lt;P&gt;Your JSON Data needs to be extracted from &lt;CODE&gt;_raw&lt;/CODE&gt;, which I have done using &lt;CODE&gt;rex&lt;/CODE&gt; command and extracted &lt;CODE&gt;jsonData&lt;/CODE&gt;. The jsonData is fed to &lt;CODE&gt;spath&lt;/CODE&gt; command as input to extract all the fields. Finally &lt;CODE&gt;where&lt;/CODE&gt; command is used to implement the filter you need. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|  makeresults
|  eval _raw="CLASS=Test MTD=getMethod LN=10 : METRICS_JSON_NODE=
\"ABC\": [
{
\"A\": \"abc\",
\"B\": \"c1b1a1\",
\"C\": 987654321,
\"D\": 123,
\"E\": 123456789,
\"F\": false,
\"G\": \"bcfaff1d50025094089f5a02d0dbd00e568d7dbe\"
}
]
}"
|  rex "(?ms)\"ABC\": \[(?&amp;lt;jsonData&amp;gt;[^\]]+\])"
|  spath input=jsonData
|  where C=987654321 AND isnotnull(E)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 09:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299524#M56659</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-21T09:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search specific object value of json data in spunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299525#M56660</link>
      <description>&lt;P&gt;You can also try &lt;CODE&gt;search&lt;/CODE&gt; command instead of final &lt;CODE&gt;where&lt;/CODE&gt; pipe&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;YourBaseSearch&amp;gt;
|  rex "(?ms)\"ABC\": \[(?&amp;lt;jsonData&amp;gt;[^\]]+\])"
|  spath input=jsonData
| search C=987654321 AND E=*
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 09:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299525#M56660</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-21T09:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I search specific object value of json data in spunk?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299526#M56661</link>
      <description>&lt;P&gt;@chaithanyaSplunk, can you please confirm whether this resolved your issue or not?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2017 04:13:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-search-specific-object-value-of-json-data-in-spunk/m-p/299526#M56661</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-24T04:13:22Z</dc:date>
    </item>
  </channel>
</rss>

