<?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 Can you help us parse the following JSON ? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416123#M73535</link>
    <description>&lt;P&gt;i have tried the spath command, but no results. I would like to display the below data into a table as shown below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10:40:19.682 INFO  com.sample.splunk.service.splunkService - Splunk_SampleJson —&amp;gt;{“fileNamesList:[{“fileName”:”fileName1.zip"},{"fileName":"fileName2.zip”},{“fileName":"fileName3.zip”}]} I wanted to get data in table format 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;FileName&lt;BR /&gt;
——————&lt;BR /&gt;
fileName1&lt;BR /&gt;
fileName2&lt;BR /&gt;
FileName3&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 18:51:37 GMT</pubDate>
    <dc:creator>saranya12</dc:creator>
    <dc:date>2019-01-21T18:51:37Z</dc:date>
    <item>
      <title>Can you help us parse the following JSON ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416123#M73535</link>
      <description>&lt;P&gt;i have tried the spath command, but no results. I would like to display the below data into a table as shown below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10:40:19.682 INFO  com.sample.splunk.service.splunkService - Splunk_SampleJson —&amp;gt;{“fileNamesList:[{“fileName”:”fileName1.zip"},{"fileName":"fileName2.zip”},{“fileName":"fileName3.zip”}]} I wanted to get data in table format 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;FileName&lt;BR /&gt;
——————&lt;BR /&gt;
fileName1&lt;BR /&gt;
fileName2&lt;BR /&gt;
FileName3&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 18:51:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416123#M73535</guid>
      <dc:creator>saranya12</dc:creator>
      <dc:date>2019-01-21T18:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help us parse the following JSON ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416124#M73536</link>
      <description>&lt;P&gt;Thats probably because spath works on pure json data and your long entry is not pure json (it has those timestamps and other info before the json portion). You can extract the json portion into a  new field and use spath on that, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex "^([^\{]+)(?&amp;lt;jsondata&amp;gt;.+)$" | spath input=jsondata
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 20:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416124#M73536</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-01-21T20:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help us parse the following JSON ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416125#M73537</link>
      <description>&lt;P&gt;Thank you worked for me , adding complete search query it might help some one &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;my base search | rex "^([^\{]+)(?&amp;lt;jsondata&amp;gt;.+)$" |spath input=jsondata output=fileName path=fileNamesList{}.fileName |table fileName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 20:30:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416125#M73537</guid>
      <dc:creator>saranya12</dc:creator>
      <dc:date>2019-01-21T20:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help us parse the following JSON ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416126#M73538</link>
      <description>&lt;P&gt;Thanks for sharing your working search. Please remember to format your searches/code snippet by selecting the query and clicking on "101010" button on the top of the text area. &lt;/P&gt;

&lt;P&gt;Please mark this question answered by accepting this as an answer.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 21:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416126#M73538</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-01-21T21:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help us parse the following JSON ?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416127#M73539</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
|  eval _raw="10:40:19.682 INFO com.sample.splunk.service.splunkService - Splunk_SampleJson —&amp;gt;{\"fileNamesList:[{\"fileName\":\"fileName1.zip\"},{\"fileName\":\"fileName2.zip\"},{\"fileName\":\"fileName3.zip\"}]}"

| rename COMMENT AS "Everything above generates sample event data; everything below is your solution"

| rex max_match=0 "\"fileName\":\"(?&amp;lt;fileName&amp;gt;[^\"]+)"
| table fileName
| mvexpand fileName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may not need the last line (try with and without).&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 22:15:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-us-parse-the-following-JSON/m-p/416127#M73539</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-01-21T22:15:16Z</dc:date>
    </item>
  </channel>
</rss>

