<?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 create table from JSON? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598607#M208437</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Here you are. So my code is pinging remote machines and the response is in JSON file. I would like to table the host and success from this response file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-20 at 12.13.28 AM.png" style="width: 500px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19735i0701CA36624E412F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-05-20 at 12.13.28 AM.png" alt="Screen Shot 2022-05-20 at 12.13.28 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 20 May 2022 05:17:51 GMT</pubDate>
    <dc:creator>Khanu89</dc:creator>
    <dc:date>2022-05-20T05:17:51Z</dc:date>
    <item>
      <title>How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598595#M208431</link>
      <description>&lt;P&gt;Hello - Thank you in advance for the help. I am getting following raw data in Splunk events which I'd like to pull into a table format.&lt;/P&gt;
&lt;P&gt;I would like to pull the following: Host, Success, and Error field as columns for my table.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-19 at 10.06.55 PM.png" style="width: 438px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19732iA0D45FC74A60FDFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-05-19 at 10.06.55 PM.png" alt="Screen Shot 2022-05-19 at 10.06.55 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried this query but no success:&lt;BR /&gt;&lt;BR /&gt;| makeresults&lt;BR /&gt;| eval _raw="{\"host\"},{\"success\",{\"error\"}"&lt;BR /&gt;| spath path=host{} output=temp&lt;BR /&gt;| mvexpand temp&lt;BR /&gt;| spath input=temp&lt;BR /&gt;| fillnull value="None"&lt;BR /&gt;| table host,success,error&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 04:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598595#M208431</guid>
      <dc:creator>Khanu89</dc:creator>
      <dc:date>2022-05-20T04:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598604#M208435</link>
      <description>&lt;P&gt;It looks like (from the graphic) that host, success and error are elements of an object, which is part of a collection of similar objects. Is this right? Can you share a larger example of the whole event in a code block rather than a graphic (redacting any sensitive information of course)?&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598604#M208435</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-20T05:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598607#M208437</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;Here you are. So my code is pinging remote machines and the response is in JSON file. I would like to table the host and success from this response file.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-20 at 12.13.28 AM.png" style="width: 500px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19735i0701CA36624E412F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-05-20 at 12.13.28 AM.png" alt="Screen Shot 2022-05-20 at 12.13.28 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:17:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598607#M208437</guid>
      <dc:creator>Khanu89</dc:creator>
      <dc:date>2022-05-20T05:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598608#M208438</link>
      <description>&lt;P&gt;It looks like from your graphic that the JSON has been split across multiple events - is that right?&lt;/P&gt;&lt;P&gt;If so, will host, success and error always be in the same event?&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598608#M208438</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-20T05:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598611#M208439</link>
      <description>&lt;P&gt;yeah I do not know why they are split up in multiple events but the host, success and error will be in same event.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598611#M208439</guid>
      <dc:creator>Khanu89</dc:creator>
      <dc:date>2022-05-20T05:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598614#M208440</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; hope this helps.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-20 at 12.27.06 AM.png" style="width: 531px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19736i6AD3C4035EBFEF33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2022-05-20 at 12.27.06 AM.png" alt="Screen Shot 2022-05-20 at 12.27.06 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my JSON file&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-05-20 at 12.30.06 AM.png" style="width: 317px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19737iC931DFA4C007F2CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-05-20 at 12.30.06 AM.png" alt="Screen Shot 2022-05-20 at 12.30.06 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598614#M208440</guid>
      <dc:creator>Khanu89</dc:creator>
      <dc:date>2022-05-20T05:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598615#M208441</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "\"host\":\s(?&amp;lt;host&amp;gt;[^,]*),.*?\"success\":\s(?&amp;lt;success&amp;gt;[^,]*),.*?\"error\":\s(?&amp;lt;error&amp;gt;[^,]*),"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 20 May 2022 05:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598615#M208441</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-20T05:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598616#M208442</link>
      <description>&lt;P&gt;I tried and it didn't extract any fields.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:36:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598616#M208442</guid>
      <dc:creator>Khanu89</dc:creator>
      <dc:date>2022-05-20T05:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598617#M208443</link>
      <description>&lt;P&gt;It looks like your file is being broken into events by the presence of timestamps rather than the end of the array element&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598617#M208443</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-20T05:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to create table from JSON?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598618#M208444</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?ms)\"host\":\s(?&amp;lt;host&amp;gt;[^,]*),.*?\"success\":\s(?&amp;lt;success&amp;gt;[^,]*),.*?\"error\":\s(?&amp;lt;error&amp;gt;[^,]*),"&lt;/LI-CODE&gt;&lt;P&gt;I haven't tested this because I don't have an example to use (which is why I asked for the event to be in a code block, and I am not about to type it all in)&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 05:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-table-from-JSON/m-p/598618#M208444</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-20T05:42:26Z</dc:date>
    </item>
  </channel>
</rss>

