<?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 How to Parse Json array with inner condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Parse-Json-array-with-inner-condition/m-p/593579#M206604</link>
    <description>&lt;P&gt;I cant seem to find an example parsing a json array with no parent.&lt;/P&gt;
&lt;P&gt;Meaning, I need to parse: [{"key1":"value2}, {"key1", "value2}].&lt;/P&gt;
&lt;P&gt;But I only see examples with: "{"MyList" :&amp;nbsp;[{"key1":"value2}, {"key1", "value2}]}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the json I have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{
	"id": "123",
	"percentage": 25.0,
	"active": true,
	"second_id": "456",
	"creation time": "2022-04-13T09:30:06.517",
	"event_age": {
		"hours": 3,
		"minutes": 4,
		"seconds": 2
	}
}, {
		"id": "789",
	"percentage": 56.0,
	"active": true,
	"second_id": "222",
	"creation time": "2022-04-13T09:30:06.517",
	"event_age": {
		"hours": 6,
		"minutes": 2,
		"seconds": 2
	}
}]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to filter only the records which their event_age&amp;gt;4 and present it in a table.&lt;/P&gt;
&lt;TABLE border="1" width="73.46938775510205%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;id&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;percentage&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;active&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;second_id&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;creation time&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;event_age&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;789&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;56&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;true&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;222&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;2022-04-13T09:30:06.517&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;hours: 6,&lt;BR /&gt;minutes :6,&lt;BR /&gt;seconds: 2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 15:12:59 GMT</pubDate>
    <dc:creator>ofer_s</dc:creator>
    <dc:date>2022-04-13T15:12:59Z</dc:date>
    <item>
      <title>How to Parse Json array with inner condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Parse-Json-array-with-inner-condition/m-p/593579#M206604</link>
      <description>&lt;P&gt;I cant seem to find an example parsing a json array with no parent.&lt;/P&gt;
&lt;P&gt;Meaning, I need to parse: [{"key1":"value2}, {"key1", "value2}].&lt;/P&gt;
&lt;P&gt;But I only see examples with: "{"MyList" :&amp;nbsp;[{"key1":"value2}, {"key1", "value2}]}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the json I have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[{
	"id": "123",
	"percentage": 25.0,
	"active": true,
	"second_id": "456",
	"creation time": "2022-04-13T09:30:06.517",
	"event_age": {
		"hours": 3,
		"minutes": 4,
		"seconds": 2
	}
}, {
		"id": "789",
	"percentage": 56.0,
	"active": true,
	"second_id": "222",
	"creation time": "2022-04-13T09:30:06.517",
	"event_age": {
		"hours": 6,
		"minutes": 2,
		"seconds": 2
	}
}]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to filter only the records which their event_age&amp;gt;4 and present it in a table.&lt;/P&gt;
&lt;TABLE border="1" width="73.46938775510205%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;id&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;percentage&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;active&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;second_id&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;creation time&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;event_age&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;789&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;56&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;true&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;222&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;2022-04-13T09:30:06.517&lt;/TD&gt;
&lt;TD width="14.285714285714286%" height="25px"&gt;hours: 6,&lt;BR /&gt;minutes :6,&lt;BR /&gt;seconds: 2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 15:12:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Parse-Json-array-with-inner-condition/m-p/593579#M206604</guid>
      <dc:creator>ofer_s</dc:creator>
      <dc:date>2022-04-13T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Parse Json array with inner condition</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Parse-Json-array-with-inner-condition/m-p/593596#M206609</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/244858"&gt;@ofer_s&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can extract your required values using below search. Here, you need to change where condition as per your requirement. I have&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH 
| spath path={} output=raw | mvexpand raw | rename raw as _raw | spath
| where 'event_age.hours' &amp;gt; 4&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="[{\"id\": \"123\",\"percentage\": 25.0,\"active\": true,\"second_id\": \"456\",\"creation time\": \"2022-04-13T09:30:06.517\",\"event_age\": {\"hours\": 3,\"minutes\": 4,\"seconds\": 2}}, {\"id\": \"789\",\"percentage\": 56.0,\"active\": true,\"second_id\": \"222\",\"creation time\": \"2022-04-13T09:30:06.517\",	\"event_age\": {\"hours\": 6,\"minutes\": 2,\"seconds\": 2}}]" 
|rename comment as "Upto now is for sample data only" 
| spath path={} output=raw | mvexpand raw | rename raw as _raw | spath
| where 'event_age.hours' &amp;gt; 4&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-04-13 at 6.37.51 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19053i633B9133A4D6EC67/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2022-04-13 at 6.37.51 PM.png" alt="Screenshot 2022-04-13 at 6.37.51 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 13:08:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Parse-Json-array-with-inner-condition/m-p/593596#M206609</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2022-04-13T13:08:07Z</dc:date>
    </item>
  </channel>
</rss>

