<?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: Extract Fields from JSON in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508500#M142082</link>
    <description>&lt;P&gt;Hi, sorry for the late reply and thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason your code works for some fields and others don't. Please see the image attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas that might help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-07-10 at 12.49.06 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9605i2F5469F98CF2029A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-10 at 12.49.06 PM.png" alt="Screen Shot 2020-07-10 at 12.49.06 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to get the JSON of Purging_Results: {all content in here} using regex and then navigate to the fields using a spath?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 15:26:17 GMT</pubDate>
    <dc:creator>felipesodre</dc:creator>
    <dc:date>2020-07-10T15:26:17Z</dc:date>
    <item>
      <title>Extract Fields from JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508397#M142055</link>
      <description>&lt;P&gt;Hi Everyone. Thanks in advance for any help.&lt;/P&gt;&lt;P&gt;I am trying to extract some fields (Status, RecordsPurged)&amp;nbsp; from a JSON on the following _raw text:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"": "INFO : 2020-07-09T01:11:08Z : [database@test.com]: {\"Purging_Results_Test\": {\"NewPurging\": 1, \"Status\":\"Successful\", \"VacuumEnabled\": true, \"RecordsPurged\": 6646, \"StartTime\":\"8-Jul-2020 18:03:07\", \"EndTime\":\"8-Jul-2020 18:11:08\", \"Duration(min)\":8.02}}"} &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any Ideas that might help me out?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you so much.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 20:37:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508397#M142055</guid>
      <dc:creator>felipesodre</dc:creator>
      <dc:date>2020-07-09T20:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Fields from JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508406#M142059</link>
      <description>&lt;P&gt;Normally, one uses &lt;FONT face="courier new,courier"&gt;spath&lt;/FONT&gt; to parse JSON, but it doesn't like your sample text.&amp;nbsp; So &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; will do, instead.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... | rex "Status\":\"(?&amp;lt;Status&amp;gt;\w+)" | rex "RecordsPurged\": (?&amp;lt;RecordsPurged&amp;gt;\d+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 21:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508406#M142059</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-09T21:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Fields from JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508500#M142082</link>
      <description>&lt;P&gt;Hi, sorry for the late reply and thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some reason your code works for some fields and others don't. Please see the image attached.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas that might help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-07-10 at 12.49.06 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9605i2F5469F98CF2029A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-10 at 12.49.06 PM.png" alt="Screen Shot 2020-07-10 at 12.49.06 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to get the JSON of Purging_Results: {all content in here} using regex and then navigate to the fields using a spath?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:26:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508500#M142082</guid>
      <dc:creator>felipesodre</dc:creator>
      <dc:date>2020-07-10T15:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Fields from JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508525#M142091</link>
      <description>&lt;P&gt;You mean like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="{\"\": \"INFO : 2020-07-09T01:11:08Z : [database@test.com]: {\"Purging_Results_Test\": {\"NewPurging\": 1, \"Status\":\"Successful\", \"VacuumEnabled\": true, \"RecordsPurged\": 6646, \"StartTime\":\"8-Jul-2020 18:03:07\", \"EndTime\":\"8-Jul-2020 18:11:08\", \"Duration(min)\":8.02}}\"}"
| rex "Purging_Results_Test\": (?&amp;lt;PurgingResultsTest&amp;gt;.*?})"
| spath input=PurgingResultsTest&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 16:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508525#M142091</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-10T16:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Fields from JSON</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508529#M142093</link>
      <description>&lt;P&gt;It just worked perfectly.&lt;/P&gt;&lt;P&gt;Thank you so much, appreciate it!!!!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 17:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-Fields-from-JSON/m-p/508529#M142093</guid>
      <dc:creator>felipesodre</dc:creator>
      <dc:date>2020-07-10T17:13:15Z</dc:date>
    </item>
  </channel>
</rss>

