<?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 Extract JSON fields in mixed data structure with props in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300257#M90402</link>
    <description>&lt;P&gt;I have an event with a mix of JSON and non-JSON data. I have successfully extracted a Payload field with props whose value is a JSON data structure. Then using the search &lt;CODE&gt;| spath input=Payload&lt;/CODE&gt;, the value is successfully parsed into KV pairs. But how do I move this to a config file for automatic extraction? I was looking at an &lt;CODE&gt;EVAL-&lt;/CODE&gt; statement with the &lt;CODE&gt;spath()&lt;/CODE&gt; function, but it's not clear what the "Y" value should be if I want to extract all of the fields, not just a specific one:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;EVAL-Payload = spath(Payload, "*")&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Oct 2017 04:31:54 GMT</pubDate>
    <dc:creator>_smp_</dc:creator>
    <dc:date>2017-10-07T04:31:54Z</dc:date>
    <item>
      <title>Extract JSON fields in mixed data structure with props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300257#M90402</link>
      <description>&lt;P&gt;I have an event with a mix of JSON and non-JSON data. I have successfully extracted a Payload field with props whose value is a JSON data structure. Then using the search &lt;CODE&gt;| spath input=Payload&lt;/CODE&gt;, the value is successfully parsed into KV pairs. But how do I move this to a config file for automatic extraction? I was looking at an &lt;CODE&gt;EVAL-&lt;/CODE&gt; statement with the &lt;CODE&gt;spath()&lt;/CODE&gt; function, but it's not clear what the "Y" value should be if I want to extract all of the fields, not just a specific one:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;EVAL-Payload = spath(Payload, "*")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 04:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300257#M90402</guid>
      <dc:creator>_smp_</dc:creator>
      <dc:date>2017-10-07T04:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extract JSON fields in mixed data structure with props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300258#M90403</link>
      <description>&lt;P&gt;Hi @scottprigge &lt;BR /&gt;
I have the same issue here with a JSON payload, but I couldn't figure out how to extract the data on the JSON field to make the data search. Can you show me how you manage to get the data of the JSON payload within the props?&lt;/P&gt;

&lt;P&gt;one of my events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05/18/2019 00:00:00 +0200, info_search_time=1558442780.272, application=axo, createDate="01/01/2019", description=mydesc, id=123456789, results="{\"results\":{\"myDate\":\"27/04/2019\",\"myId\":\"3215AAA_24369\",\"myClientId\":\"12345\",\"myType\":\"Total\"}}"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My props.conf for this sourcetype:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[extract_json]
REGEX = \"(?&amp;lt;field&amp;gt;[^\"]+)\":\"(?&amp;lt;value&amp;gt;[^\"]+)
FORMAT= "$1"::"$2"
WRITE_META = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I couldn't make this thing work.&lt;/P&gt;

&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:39:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300258#M90403</guid>
      <dc:creator>faguilar</dc:creator>
      <dc:date>2019-05-21T10:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract JSON fields in mixed data structure with props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300259#M90404</link>
      <description>&lt;P&gt;Please see similar question and answer&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/117121/extract-json-data-within-the-logs-json-mixed-with.html"&gt;https://answers.splunk.com/answers/117121/extract-json-data-within-the-logs-json-mixed-with.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300259#M90404</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-21T10:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Extract JSON fields in mixed data structure with props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300260#M90405</link>
      <description>&lt;P&gt;@faguilar , please find the similar post below&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300260#M90405</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-21T10:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract JSON fields in mixed data structure with props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300261#M90406</link>
      <description>&lt;P&gt;Thank you @koshyk!!! Sorry I didn't saw the answer&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 13:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300261#M90406</guid>
      <dc:creator>faguilar</dc:creator>
      <dc:date>2019-05-21T13:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Extract JSON fields in mixed data structure with props</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300262#M90407</link>
      <description>&lt;P&gt;no probs. if it has helped you, please upvote/accept. cheers&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 16:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-JSON-fields-in-mixed-data-structure-with-props/m-p/300262#M90407</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2019-05-22T16:16:04Z</dc:date>
    </item>
  </channel>
</rss>

