<?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: Splunk search  show results from JSON in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485600#M83134</link>
    <description>&lt;P&gt;Thanks for this also. Can you also show how to search events where field yyy has value "yy-564".. I'm a bit newbie here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 08:01:27 GMT</pubDate>
    <dc:creator>panulpet</dc:creator>
    <dc:date>2020-03-05T08:01:27Z</dc:date>
    <item>
      <title>Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485595#M83129</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have following JSON data coming in:&lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "event_timestamp" : "2020-03-03 T 12:56:54 +0200",&lt;BR /&gt;
  "file_timestamp" : "",&lt;BR /&gt;
  "username" : "xxxx",&lt;BR /&gt;
  "session_id" : "F23AA957F1A494C12F2B21B5A7533FF3",&lt;BR /&gt;
  "request_id" : "74b9cf97-934c-41cb-b81e-1152f51e28b7",&lt;BR /&gt;
  "register_id" : [ ],&lt;BR /&gt;
  "system_id" : "ASDFG",&lt;BR /&gt;
  "environment" : "LINUX",&lt;BR /&gt;
  "service_id" : "12355",&lt;BR /&gt;
  "parameters" : [ {&lt;BR /&gt;
    "field" : "xxx",&lt;BR /&gt;
    "value" : "xx-123",&lt;BR /&gt;
    "search" : false,&lt;BR /&gt;
    "securityProhibition" : false&lt;BR /&gt;
  }, {&lt;BR /&gt;
    "field" : "yyy",&lt;BR /&gt;
    "value" : "yy-564",&lt;BR /&gt;
    "search" : false,&lt;BR /&gt;
    "securityProhibition" : false&lt;BR /&gt;
  }, {&lt;BR /&gt;
    "field" : "zzz",&lt;BR /&gt;
    "value" : "1234433222",&lt;BR /&gt;
    "search" : false,&lt;BR /&gt;
    "securityProhibition" : false&lt;BR /&gt;
  }, {&lt;BR /&gt;
    "field" : "vvv",&lt;BR /&gt;
    "value" : "&lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt;",&lt;BR /&gt;
    "search" : false,&lt;BR /&gt;
    "securityProhibition" : false&lt;BR /&gt;
  }, {&lt;BR /&gt;
    "field" : "qqq",&lt;BR /&gt;
    "value" : "qwert",&lt;BR /&gt;
    "search" : false,&lt;BR /&gt;
    "securityProhibition" : false&lt;BR /&gt;
  } ],&lt;BR /&gt;
  "info" : null,&lt;BR /&gt;
  "error" : [ {&lt;BR /&gt;
    "code" : "202",&lt;BR /&gt;
    "message" : "General Error"&lt;BR /&gt;
  } ],&lt;BR /&gt;
  "schema_version" : "1.0"&lt;BR /&gt;
};&lt;/P&gt;

&lt;P&gt;I have Dashboard where users can make searches based on given values. For example, users can search events selecting yyy (dropdown) and giving value "yy-564" and Splunk tries to search all events where that can be found. For example here I populate the search like this:  index=myindex (parameters{}.field="yyy" AND  parameters{}.value="yy-564").. That works but it also finds the events where that value "yy-564" is on another parameter field like in zzz.&lt;/P&gt;

&lt;P&gt;Any Ideas on how should I make this to work the correct way. So that It would only match inside parameters field "yyy" and it's corresponding value "yy-564"?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:27:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485595#M83129</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-09-30T04:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485596#M83130</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="{\"event_timestamp\":\"2020-03-03 T 12:56:54 +0200\",\"file_timestamp\":\"\",\"username\":\"xxxx\",\"session_id\":\"F23AA957F1A494C12F2B21B5A7533FF3\",\"request_id\":\"74b9cf97-934c-41cb-b81e-1152f51e28b7\",\"register_id\":[],\"system_id\":\"ASDFG\",\"environment\":\"LINUX\",\"service_id\":\"12355\",\"parameters\":[{\"field\":\"xxx\",\"value\":\"xx-123\",\"search\":false,\"securityProhibition\":false},{\"field\":\"yyy\",\"value\":\"yy-564\",\"search\":false,\"securityProhibition\":false},{\"field\":\"zzz\",\"value\":\"1234433222\",\"search\":false,\"securityProhibition\":false},{\"field\":\"vvv\",\"value\":\"www.google.com\",\"search\":false,\"securityProhibition\":false},{\"field\":\"qqq\",\"value\":\"qwert\",\"search\":false,\"securityProhibition\":false}],\"info\":null,\"error\":[{\"code\":\"202\",\"message\":\"General Error\"}],\"schema_version\":\"1.0\"}\";" 
| spath path=parameters{} output=parameters 
| spath 
| stats values(*) as * by parameters 
| spath input=parameters 
| fields - parameters* 
| rename error{}.* as *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if you make table like above, search is easy way.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2020 22:23:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485596#M83130</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-04T22:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485597#M83131</link>
      <description>&lt;P&gt;Thanks for this. Still wondering how to search from that table &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  &lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 04:59:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485597#M83131</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-05T04:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485598#M83132</link>
      <description>&lt;P&gt;referring to @to4kawa SPL, I performed minor changes to achieve the result &lt;/P&gt;

&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval json="{\"event_timestamp\":\"2020-03-03 T 12:56:54 +0200\",\"file_timestamp\":\"\",\"username\":\"xxxx\",\"session_id\":\"F23AA957F1A494C12F2B21B5A7533FF3\",\"request_id\":\"74b9cf97-934c-41cb-b81e-1152f51e28b7\",\"register_id\":[],\"system_id\":\"ASDFG\",\"environment\":\"LINUX\",\"service_id\":\"12355\",\"parameters\":[{\"field\":\"xxx\",\"value\":\"xx-123\",\"search\":false,\"securityProhibition\":false},{\"field\":\"yyy\",\"value\":\"yy-564\",\"search\":false,\"securityProhibition\":false},{\"field\":\"zzz\",\"value\":\"1234433222\",\"search\":false,\"securityProhibition\":false},{\"field\":\"vvv\",\"value\":\"www.google.com\",\"search\":false,\"securityProhibition\":false},{\"field\":\"qqq\",\"value\":\"qwert\",\"search\":false,\"securityProhibition\":false}],\"info\":null,\"error\":[{\"code\":\"202\",\"message\":\"General Error\"}],\"schema_version\":\"1.0\"}\";" 
| rex "(?&amp;lt;json&amp;gt;\{.+)" 
| spath input=json 
| fields - json 
| rename parameters{}.* as * 
| eval fieldValue=mvzip(field,value) 
| mvexpand fieldValue 
| eval fieldValue=split(fieldValue,",") 
| eval field=mvindex(fieldValue,0) 
| eval value=mvindex(fieldValue,1) 
| fields - fieldValue search securityProhibition
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Mar 2020 05:52:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485598#M83132</guid>
      <dc:creator>sumanssah</dc:creator>
      <dc:date>2020-03-05T05:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485599#M83133</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;.... 
| search  field="yyy"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Mar 2020 06:43:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485599#M83133</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-03-05T06:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485600#M83134</link>
      <description>&lt;P&gt;Thanks for this also. Can you also show how to search events where field yyy has value "yy-564".. I'm a bit newbie here &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 08:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485600#M83134</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-05T08:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485601#M83135</link>
      <description>&lt;P&gt;Or maybe like this - populating new search after that:&lt;/P&gt;

&lt;P&gt;| search field="yyy" value="yy-564" &lt;/P&gt;

&lt;P&gt;? Am I right?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 08:14:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485601#M83135</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-05T08:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485602#M83136</link>
      <description>&lt;P&gt;I'm near to get this working as I want &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex | rex "(?&amp;lt;json&amp;gt;\{.+)" 
 | spath input=json 
 | fields - json 
 | rename parameters{}.* as * 
 | eval fieldValue=mvzip(field,value) 
 | mvexpand fieldValue 
 | eval fieldValue=split(fieldValue,",") 
 | eval field=mvindex(fieldValue,0) 
 | eval value=mvindex(fieldValue,1) 
 | fields - fieldValue search securityProhibition | search field="*" value="*" | table event_timestamp request_id service_id system_id parameters{}.field parameters{}.value _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The only thing here is that earlier "parameters{}.field and parameters{}.value"  populated table with all values. Now that part is empty. How I "print" all field names and values to table from that certain event? Did you get the point &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  &lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 09:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485602#M83136</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-05T09:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485603#M83137</link>
      <description>&lt;P&gt;Thanks for this!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 09:35:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485603#M83137</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-05T09:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485604#M83138</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Or I added that myValue=fieldValue which solved my case :) Thanks I'' accept this answer!!

    index=myindex | rex "(?&amp;lt;json&amp;gt;\{.+)" 
      | spath input=json 
      | fields - json 
      | rename parameters{}.* as * 
      | eval fieldValue=mvzip(field,value) 
      **|eval myValue=fieldValue**
      | mvexpand fieldValue 
      | eval fieldValue=split(fieldValue,",") 
      | eval field=mvindex(fieldValue,0) 
      | eval value=mvindex(fieldValue,1) 
      | fields - fieldValue search securityProhibition 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 06:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485604#M83138</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-06T06:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk search  show results from JSON</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485605#M83139</link>
      <description>&lt;P&gt;Hi, I noticed later on that mvexpand command  shows "dublicate" events on search results on the table when searching using wildcards (*). Is is possible to prevent that or can we make query without mvexpand?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Mar 2020 05:17:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-search-show-results-from-JSON/m-p/485605#M83139</guid>
      <dc:creator>panulpet</dc:creator>
      <dc:date>2020-03-18T05:17:48Z</dc:date>
    </item>
  </channel>
</rss>

