<?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 List in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658066#M227308</link>
    <description>&lt;P&gt;Hey I have the following query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;| makeresults | eval prediction_str_body="[{'stringOutput':'Alpha','doubleOutput':0.52},{'stringOutput':'Beta','doubleOutput':0.48}]"&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But no matter what I do, I can't seem to extract each element of the list and turn it into it's own event.&lt;BR /&gt;&lt;BR /&gt;I'd ideally like a table afterwards of the sum of each value:&lt;BR /&gt;&lt;BR /&gt;Alpha: 0.52&lt;BR /&gt;Beta: 0.48&lt;BR /&gt;&lt;BR /&gt;For all rows.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 20 Sep 2023 00:35:36 GMT</pubDate>
    <dc:creator>srajabi</dc:creator>
    <dc:date>2023-09-20T00:35:36Z</dc:date>
    <item>
      <title>How to parse JSON List</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658066#M227308</link>
      <description>&lt;P&gt;Hey I have the following query:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;| makeresults | eval prediction_str_body="[{'stringOutput':'Alpha','doubleOutput':0.52},{'stringOutput':'Beta','doubleOutput':0.48}]"&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But no matter what I do, I can't seem to extract each element of the list and turn it into it's own event.&lt;BR /&gt;&lt;BR /&gt;I'd ideally like a table afterwards of the sum of each value:&lt;BR /&gt;&lt;BR /&gt;Alpha: 0.52&lt;BR /&gt;Beta: 0.48&lt;BR /&gt;&lt;BR /&gt;For all rows.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 00:35:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658066#M227308</guid>
      <dc:creator>srajabi</dc:creator>
      <dc:date>2023-09-20T00:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse JSON List</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658068#M227310</link>
      <description>&lt;P&gt;Pro tip: It is great that you are using makeresults to post simulation. &amp;nbsp;But do not mangle JSON.&lt;/P&gt;&lt;P&gt;The command you are looking for is &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Mvexpand" target="_blank" rel="noopener"&gt;mvexpand&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval prediction_str_body="[{\"stringOutput\":\"Alpha\",\"doubleOutput\":0.52},{\"stringOutput\":\"Beta\",\"doubleOutput\":0.48}]"
| spath input=prediction_str_body path={}
| mvexpand {}
| spath input={}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your sample gives&lt;/P&gt;&lt;TABLE width="426px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="43.9375px"&gt;doubleOutput&lt;/TD&gt;&lt;TD width="51.515625px"&gt;stringOutput&lt;/TD&gt;&lt;TD width="329.578125px"&gt;{}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="43.9375px"&gt;0.48&lt;/TD&gt;&lt;TD width="51.515625px"&gt;Beta&lt;/TD&gt;&lt;TD width="329.578125px"&gt;{"stringOutput":"Beta","doubleOutput":0.48}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 01:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658068#M227310</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-09-20T01:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse JSON List</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658072#M227313</link>
      <description>&lt;P&gt;Ah wonderful, thanks so much!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2023 01:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-JSON-List/m-p/658072#M227313</guid>
      <dc:creator>srajabi</dc:creator>
      <dc:date>2023-09-20T01:57:05Z</dc:date>
    </item>
  </channel>
</rss>

