<?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: how to show json data from different places in a table in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636740#M108908</link>
    <description>&lt;P&gt;Please find my events:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2023-03-30 13:41:52,578 - __main__ - INFO - {"Id": "123456JKL", "Table1": "employee", "department": "admin"}
2023-03-30 13:41:52,474 - __main__ - INFO - {"Id": "123456JKL", "Table2": "salary", "joineddate": "value"}
2023-03-30 13:41:51,873 - __main__ - INFO - {"Id": "123456JKL", "pay": "{type:"test","name":"jas"}", "joineddate": "value", "address": "US"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to show all the info belong to one ID in single row.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 15:58:26 GMT</pubDate>
    <dc:creator>Jasmine</dc:creator>
    <dc:date>2023-03-30T15:58:26Z</dc:date>
    <item>
      <title>How to show json data from different places in a table?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636655#M108883</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;i have below json data in splunk logs at different places(different rows). All are belongs to the unique id :&amp;nbsp;123456JKL..&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{"Id": "123456JKL", "Table1": "employee", "department": "admin"}&lt;BR /&gt;{"Id": "123456JKL", "Table2": "salary", "joineddate": "value"}&lt;BR /&gt;{"Id": "123456JKL", "pay": "{type:"test","name":"jas"}", "joineddate": "value"}&lt;/P&gt;
&lt;P&gt;i want to show all json data&amp;nbsp; under same Id in&amp;nbsp; a single row in splunk dashboard. Need to group by common value&amp;nbsp;&amp;nbsp;"Id": "123456JKL"&lt;/P&gt;
&lt;P&gt;Please help here&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 15:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636655#M108883</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-30T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636657#M108884</link>
      <description>&lt;LI-CODE lang="markup"&gt;| spath
| stats values(*) as * by id&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 09:35:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636657#M108884</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T09:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636665#M108885</link>
      <description>&lt;P&gt;i tried. but i dont see any data in table format .. but says 4 events.&lt;/P&gt;&lt;P&gt;this is my actual query&lt;/P&gt;&lt;P&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id" | spath | stats values(*) as * by Id&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:07:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636665#M108885</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-30T10:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636668#M108887</link>
      <description>&lt;P&gt;Please can you share some anonymised sample events in a code block &amp;lt;/&amp;gt; so that formatting is preserved?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636668#M108887</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T10:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636679#M108890</link>
      <description>&lt;P&gt;my search query in&amp;nbsp; splunk is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;/&amp;gt; sourcetype="test" index=aaa env=test family=jas app=demo "Id"&amp;nbsp;&amp;lt;/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My search result from the above query is below with timestamps:&lt;/P&gt;&lt;P&gt;will this json format good to show in splunk dashboard ?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;{"Id": "123456JKL", "Table1": "employee", "department": "admin"}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{"Id": "123456JKL", "Table2": "salary", "joineddate": "value"}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{"Id": "123456JKL", "pay": "{type:"test","name":"jas"}", "joineddate": "value"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i tied as below to show the columns in single row - (group by id - for each row)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ID , Table1, department, Table2, joineddate, pay,joineddate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;/&amp;gt; sourcetype="test" index=aaa env=test family=jas app=demo "Id" | spath |stats values(*) as * by Id&amp;nbsp;&amp;lt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but i dont see any data.. Please help me&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 10:52:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636679#M108890</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-30T10:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636688#M108891</link>
      <description>&lt;P&gt;By code block I meant this &amp;lt;/&amp;gt; button&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1680174551825.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24634i5BD7D12ECA7D0E23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1680174551825.png" alt="ITWhisperer_0-1680174551825.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For example, here is a runanywhere example for your usecase&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="{\"Id\": \"123456JKL\", \"Table1\": \"employee\", \"department\": \"admin\"}
{\"Id\": \"123456JKL\", \"Table2\": \"salary\", \"joineddate\": \"value\"}
{\"Id\": \"123456JKL\", \"pay\": \"{type:\\\"test\\\",\\\"name\\\":\\\"jas\\\"}\", \"joineddate\": \"value\"}"
| multikv noheader=t
| fields _raw
| spath
| stats values(*) as * by Id&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Note that I have modified your example to make the JSON valid for embedded JSON strings&lt;/P&gt;&lt;P&gt;Here is the example where pay is an embedded JSON object rather than a string&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="{\"Id\": \"123456JKL\", \"Table1\": \"employee\", \"department\": \"admin\"}
{\"Id\": \"123456JKL\", \"Table2\": \"salary\", \"joineddate\": \"value\"}
{\"Id\": \"123456JKL\", \"pay\": {\"type\":\"test\",\"name\":\"jas\"}, \"joineddate\": \"value\"}"
| multikv noheader=t
| fields _raw
| spath
| stats values(*) as * by Id&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 11:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636688#M108891</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T11:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636710#M108903</link>
      <description>&lt;P&gt;ok. I have three more questions:&lt;/P&gt;&lt;P&gt;1) How can I integrate makeresults with sourcetype , index, family... I tried as below. but not working. can you please suggest me&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id" |append  [| makeresults 
    | eval fields1=split(_raw,":") | multikv noheader=t
| fields fields1
| spath
| stats values(*) as * by Id
]&lt;/LI-CODE&gt;&lt;P&gt;2)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"pay": "{type:"test","name":"jas"}"&lt;/LI-CODE&gt;&lt;P&gt;here I don't want to split in multiple columns, I want to show in single column- only for pay&lt;/P&gt;&lt;P&gt;3) do we have any built in function to embed \ in splunk as my input is as below from splunk search:&lt;/P&gt;&lt;P&gt;{"Id": "123456JKL", "Table1": "employee", "department": "admin"}&lt;BR /&gt;{"Id": "123456JKL", "Table2": "salary", "joineddate": "value"}&lt;BR /&gt;{"Id": "123456JKL", "pay": "{type:"test","name":"jas"}", "joineddate": "value"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636710#M108903</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-30T13:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636712#M108904</link>
      <description>&lt;P&gt;I have used makeresults to simulate what I think you have in your events. This is only a guess as you haven't shared your raw events or may be you have. If your raw events are just JSON structures then you can do this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id"
| spath
| stats values(*) as * by Id&lt;/LI-CODE&gt;&lt;P&gt;If not, please share your raw events in a code block &amp;lt;/&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 13:49:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636712#M108904</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T13:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636740#M108908</link>
      <description>&lt;P&gt;Please find my events:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2023-03-30 13:41:52,578 - __main__ - INFO - {"Id": "123456JKL", "Table1": "employee", "department": "admin"}
2023-03-30 13:41:52,474 - __main__ - INFO - {"Id": "123456JKL", "Table2": "salary", "joineddate": "value"}
2023-03-30 13:41:51,873 - __main__ - INFO - {"Id": "123456JKL", "pay": "{type:"test","name":"jas"}", "joineddate": "value", "address": "US"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to show all the info belong to one ID in single row.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 15:58:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636740#M108908</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-30T15:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636747#M108910</link>
      <description>&lt;P&gt;Given that you don't appear to have well-formed JSON data, and assuming the formatting is as you have shown, try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="2023-03-30 13:41:52,578 - __main__ - INFO - {\"Id\": \"123456JKL\", \"Table1\": \"employee\", \"department\": \"admin\"}
2023-03-30 13:41:52,474 - __main__ - INFO - {\"Id\": \"123456JKL\", \"Table2\": \"salary\", \"joineddate\": \"value\"}
2023-03-30 13:41:51,873 - __main__ - INFO - {\"Id\": \"123456JKL\", \"pay\": \"{type:\"test\",\"name\":\"jas\"}\", \"joineddate\": \"value\", \"address\": \"US\"}"
| multikv noheader=t
| fields _raw
``` The lines above generate your sample data ```
| rex max_match=0 "\{?\"(?&amp;lt;field&amp;gt;[^\"]+)\":\s\"(?&amp;lt;value&amp;gt;(\{.*?\}|[^\{\}]*?))\"(,\s|\})"
| eval count=mvcount(field)
| eval row=mvrange(0,count)
| streamstats count as event
| mvexpand row
| eval field = mvindex(field,row)
| eval {field} = mvindex(value,row)
| fields - row field value _raw count
| stats values(*) as * by event
| fields - event
| stats values(*) as * by Id&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 16:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636747#M108910</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T16:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636753#M108912</link>
      <description>&lt;P&gt;This looks good. But i cannot pass&amp;nbsp; static msg in eval&amp;nbsp; as&amp;nbsp; below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval _raw="2023-03-30 13:41:52,578 - __main__ - INFO - {\"Id\": \"123456JKL\", \"Table1\": \"employee\", \"department\": \"admin\"}
2023-03-30 13:41:52,474 - __main__ - INFO - {\"Id\": \"123456JKL\", \"Table2\": \"salary\", \"joineddate\": \"value\"}
2023-03-30 13:41:51,873 - __main__ - INFO - {\"Id\": \"123456JKL\", \"pay\": \"{type:\"test\",\"name\":\"jas\"}\", \"joineddate\": \"value\", \"address\": \"US\"}"&lt;/LI-CODE&gt;&lt;P&gt;as i mentioned earlier, my search would be&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id"&lt;/LI-CODE&gt;&lt;P&gt;after searching my result would be&amp;nbsp; as below:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2023-03-30 13:41:52,578 - __main__ - INFO - {"Id": "123456JKL", "Table1": "employee", "department": "admin"}
2023-03-30 13:41:52,474 - __main__ - INFO - {"Id": "123456JKL", "Table2": "salary", "joineddate": "value"}
2023-03-30 13:41:51,873 - __main__ - INFO - {"Id": "123456JKL", "pay": "{type:"test","name":"jas"}", "joineddate": "value", "address": "US"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; for this search result i want to show in single row.. Hope this helps?&lt;/P&gt;&lt;P&gt;also do we have any inbuild function to embed slashes in json values?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 17:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636753#M108912</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-30T17:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636762#M108915</link>
      <description>&lt;LI-CODE lang="markup"&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id"
| rex max_match=0 "\{?\"(?&amp;lt;field&amp;gt;[^\"]+)\":\s\"(?&amp;lt;value&amp;gt;(\{.*?\}|[^\{\}]*?))\"(,\s|\})"
| eval count=mvcount(field)
| eval row=mvrange(0,count)
| streamstats count as event
| mvexpand row
| eval field = mvindex(field,row)
| eval {field} = mvindex(value,row)
| fields - row field value _raw count
| stats values(*) as * by event
| fields - event
| stats values(*) as * by Id&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 18:44:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636762#M108915</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T18:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636818#M108919</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried the above one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting as below:&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Field 'row' does not exist in the data.&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Complete&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;3&lt;SPAN&gt;&amp;nbsp;events&lt;SPAN&gt;&amp;nbsp;(3/31/23 12:58:00.000 AM to 3/31/23 1:58:03.000 AM)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;throws error at&amp;nbsp;| mvexpand row&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;when i execute upto below piece of code&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id"
| rex max_match=0 "\{?\"(?&amp;lt;field&amp;gt;[^\"]+)\":\s\"(?&amp;lt;value&amp;gt;(\{.*?\}|[^\{\}]*?))\"(,\s|\})"
| eval count=mvcount(field)
| eval row=mvrange(0,count)
| streamstats count as event &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the output as below :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2023-03-31 05:14:16,447 - __main__ - INFO - "{\"Id\": \"123456JKL\", \"Table1\": \"employee\", \"Time1\": \"3.04\"}"&lt;/P&gt;&lt;P&gt;2023-03-31 05:14:16,393 - __main__ - INFO - "{\"Id\": \"123456JKL\", \"Table2\": \"salary\", \"Time2\": \"4.05\"}"&lt;/P&gt;&lt;P&gt;2023-03-31 05:20:16,393 - __main__ - INFO - "{\"Id\": \"123456JKL\", \"Table2\": \"salary1\",\"PayLoad\": {\"type\":\"test\",\"name\":\"jas\"}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 06:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636818#M108919</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-31T06:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636827#M108920</link>
      <description>&lt;P&gt;This is obviously made-up data - it has been constructed differently to the previous examples which my suggestion was based on. It seems I am wasting my time trying to construct a solution based on fake data. If you want something that works with your actual data, please provide an accurate representation of your data. You can of course mask sensitive elements, but the structure and formatting should be as accurate as possible.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 06:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636827#M108920</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-31T06:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636834#M108921</link>
      <description>&lt;P&gt;Thanks for quick reply..&amp;nbsp; I am sorry. I believe i am giving same data. Per your advise i have handled backslashes for json data. (this is the only difference between my earlier one and current one). Your previous query helped me a lot. but makeresults i am not able integrate with sourcetype.&lt;/P&gt;&lt;P&gt;To be more clear&lt;/P&gt;&lt;P&gt;My search in splunk would be&lt;/P&gt;&lt;P&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id"&lt;/P&gt;&lt;P&gt;After search i get below data and have to show in same row based on Id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2023-03-31 05:14:16,447 - __main__ - INFO - "{\"Id\": \"123456JKL\", \"Table1\": \"employee\", \"Time1\": \"3.04\"}"

2023-03-31 05:14:16,393 - __main__ - INFO - "{\"Id\": \"123456JKL\", \"Table2\": \"salary\", \"Time2\": \"4.05\"}"

2023-03-31 05:20:16,393 - __main__ - INFO - "{\"Id\": \"123456JKL\", \"Table2\": \"salary1\",\"PayLoad\": {\"type\":\"test\",\"name\":\"jas\"}"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 07:30:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636834#M108921</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-31T07:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636837#M108922</link>
      <description>&lt;P&gt;Your formatting has changed again - your third line is not valid JSON - was it supposed to be?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="test" index=aaa env=test family=jas app=demo "Id"
| rex max_match=0 "\{?\\\"(?&amp;lt;field&amp;gt;[^\\\]+)\\\\\":\s(\\\\\")?(?&amp;lt;value&amp;gt;(\{.*\}|[^\\\]*))(\\\\\")?(,\s|\}|)"
| eval count=mvcount(field)
| eval row=mvrange(0,count)
| streamstats count as event
| mvexpand row
| eval field = mvindex(field,row)
| eval {field} = mvindex(value,row)
| fields - row field value _raw count
| stats values(*) as * by event
| fields - event
| stats values(*) as * by Id&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 31 Mar 2023 08:09:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636837#M108922</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-31T08:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636845#M108925</link>
      <description>&lt;P&gt;&lt;BR /&gt;Thank you very much for your patience and quick reply.&lt;/P&gt;&lt;P&gt;This is what i required.. Thanks once again.&lt;/P&gt;&lt;P&gt;Clarifications: It also provides&amp;nbsp; date_hour, date_mday,date_minute, punct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can we remove the fields which are not required&lt;/P&gt;&lt;P&gt;do we have control to change the order of columns?&lt;/P&gt;&lt;P&gt;Yes as you said third line is not properly formatted. this is my raw data.. to format properly can i just add backslashes with each items or i can work for any other format to show in splunk(single cell)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"type":"data","Id":"test","source":"In","sub":[{"eng":"30","cost":10.0,"status":"sold"}]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 08:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636845#M108925</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2023-03-31T08:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to show json data from different places in a table</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636846#M108926</link>
      <description>&lt;P&gt;With valid JSON data you can use spath (as I originally suggest) - if you want to keep to just one level of expansion of the JSON structure you could do it separately and remove the expanded fields&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath input=_raw sub{} output=sub
| spath input=_raw
| fields - sub{}.*&lt;/LI-CODE&gt;&lt;P&gt;You might need to replace "_raw" with the field name that your JSON is in&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 09:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-show-json-data-from-different-places-in-a-table/m-p/636846#M108926</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-31T09:01:02Z</dc:date>
    </item>
  </channel>
</rss>

