<?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: json to table in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461199#M79603</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/173134"&gt;@arun_kant_sharm&lt;/a&gt;a &lt;BR /&gt;
Can you please share &lt;CODE&gt;_raw&lt;/CODE&gt; from your event?&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 02:33:21 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2020-09-30T02:33:21Z</dc:date>
    <item>
      <title>json to table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461198#M79602</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;

&lt;P&gt;I want to convert Json format into table. &lt;BR /&gt;
My data have below field&lt;BR /&gt;
[ [-]&lt;BR /&gt;
   { [-]&lt;BR /&gt;
     day: Tue&lt;BR /&gt;
     dayOfMonth: 15&lt;BR /&gt;
     duration: (00:00)&lt;BR /&gt;
     month: Oct&lt;BR /&gt;
     program: ssh:notty&lt;BR /&gt;
     sourceHost: ljp1gwd01.axa-di&lt;BR /&gt;
     time: 15:09 - 15:09&lt;BR /&gt;
     user: shaikh&lt;BR /&gt;
   }&lt;BR /&gt;
   { [-]&lt;BR /&gt;
     day: Thu&lt;BR /&gt;
     dayOfMonth: 3&lt;BR /&gt;
     duration: (00:00)&lt;BR /&gt;
     month: Oct&lt;BR /&gt;
     program: ssh:notty&lt;BR /&gt;
     sourceHost: ljp1gwd01.axa-di&lt;BR /&gt;
     time: 16:33 - 16:33&lt;BR /&gt;
     user: shaikh&lt;BR /&gt;
   }&lt;BR /&gt;
]&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 04:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461198#M79602</guid>
      <dc:creator>arun_kant_sharm</dc:creator>
      <dc:date>2019-10-16T04:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: json to table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461199#M79603</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/173134"&gt;@arun_kant_sharm&lt;/a&gt;a &lt;BR /&gt;
Can you please share &lt;CODE&gt;_raw&lt;/CODE&gt; from your event?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:33:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461199#M79603</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-30T02:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: json to table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461200#M79604</link>
      <description>&lt;P&gt;[{"month": "Oct", "program": "ssh:notty", "user": "shaikh", "time": "15:09 - 15:09", "duration": "(00:00)", "sourceHost": "ljp1gwd01.axa-di", "day": "Tue", "dayOfMonth": "15"}, {"month": "Oct", "program": "ssh:notty", "user": "shaikh", "time": "16:33 - 16:33", "duration": "(00:00)", "sourceHost": "ljp1gwd01.axa-di", "day": "Thu", "dayOfMonth": "3"}]&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 05:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461200#M79604</guid>
      <dc:creator>arun_kant_sharm</dc:creator>
      <dc:date>2019-10-16T05:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: json to table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461201#M79605</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/173134"&gt;@arun_kant_sharm&lt;/a&gt;a &lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YOUR_SEARCH  | spath path="{}." output=data | mvexpand data | eval _raw=data | spath | table day dayOfMonth month duration program sourceHost time user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval _raw="[{\"day\": \"Tue\",\"dayOfMonth\": \"15\",\"duration\": \"(00:00)\",\"month\": \"Oct\",\"program\": \"ssh:notty\",\"sourceHost\": \"ljp1gwd01.axa-di\",\"time\": \"15:09 - 15:09\",\"user\": \"shaikh\" },{\"day\": \"Thu\",\"dayOfMonth\": \"3\",\"duration\": \"(00:00)\",\"month\": \"Oct\",\"program\": \"ssh:notty\",\"sourceHost\": \"ljp1gwd01.axa-di\",\"time\": \"16:33 - 16:33\",\"user\": \"shaikh\" } ]" | spath path="{}." output=data | mvexpand data | eval _raw=data | spath | table day dayOfMonth month duration program sourceHost time user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461201#M79605</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2020-09-30T02:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: json to table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461202#M79606</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/173134"&gt;@arun_kant_sharm&lt;/a&gt;a,&lt;/P&gt;

&lt;P&gt;here it is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="[ { \"day\": \"Tue\",\"dayOfMonth\": 15,\"duration\": \"(00:00)\",\"month\": \"Oct\",\"program\": \"ssh:notty\",\"sourceHost\": \"ljp1gwd01.axa-di\",\"time\": \"15:09 - 15:09\",\"user\": \"shaikh\"},{ \"day\": \"Thu\",\"dayOfMonth: 3,\"duration\": \"(00:00)\",\"month\": \"Oct\",
\"program\": \"ssh:notty\",\"sourceHost\": \"ljp1gwd01.axa-di\",\"time: \"16:33 - 16:33\",\"user\": \"shaikh\",}]"
| spath 
| rename {}.* as *
| fields - _raw
| table *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/json-to-table/m-p/461202#M79606</guid>
      <dc:creator>poete</dc:creator>
      <dc:date>2020-09-30T02:38:04Z</dc:date>
    </item>
  </channel>
</rss>

