<?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 Json string from log event in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Json-string-from-log-event/m-p/234210#M99040</link>
    <description>&lt;P&gt;You need to extract json part of your log message and pass it to spath to get the fields extracted automatically. &lt;/P&gt;

&lt;P&gt;Try this - based on your sample data above&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search |rex field=_raw "^(?:[^ \n]* ){5}(?P&amp;lt;my_json&amp;gt;\{\"\w+\":\"\w+\",\"\w+\":\"\w+\",\"\w+\":\"\w+\",\"\w+\":\"\w+\",\"\w+\":\"\d+\-\d+\-\d+\s+\d+:\d+:\d+,\d+\s+\+\d+:\d+\",\"\w+\":\{\"\w+\":\"\w+\"\}\})"|fields my_json|spath input=my_json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above filed extraction is taken from Splunk field extraction and needs to be tuned for your specific requirement&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2016 10:00:51 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2016-08-22T10:00:51Z</dc:date>
    <item>
      <title>Extract Json string from log event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Json-string-from-log-event/m-p/234209#M99039</link>
      <description>&lt;P&gt;I have below log format using search query I want to extract json string starting from category field and want automatically make key value pair attributes. Here twist is I dont have access to change conf files.&lt;/P&gt;

&lt;P&gt;2016-08-22&amp;nbsp;08:35:12,914&amp;nbsp;+00:00&amp;nbsp;[INFO] [XXXXXX] {"category":"XXXX","source":"XXXX","type":"ApplicationLaunch","referrer":"XXXXX","dateLogged":"2016-08-22&amp;nbsp;08:35:12,914&amp;nbsp;+00:00","args":{"topUrl":"XXXXXX"}}   &lt;/P&gt;

&lt;P&gt;Please help me if splunk provides such feature to extract json string using search query.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 09:39:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-Json-string-from-log-event/m-p/234209#M99039</guid>
      <dc:creator>rameshlpatel</dc:creator>
      <dc:date>2016-08-22T09:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Json string from log event</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-Json-string-from-log-event/m-p/234210#M99040</link>
      <description>&lt;P&gt;You need to extract json part of your log message and pass it to spath to get the fields extracted automatically. &lt;/P&gt;

&lt;P&gt;Try this - based on your sample data above&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search |rex field=_raw "^(?:[^ \n]* ){5}(?P&amp;lt;my_json&amp;gt;\{\"\w+\":\"\w+\",\"\w+\":\"\w+\",\"\w+\":\"\w+\",\"\w+\":\"\w+\",\"\w+\":\"\d+\-\d+\-\d+\s+\d+:\d+:\d+,\d+\s+\+\d+:\d+\",\"\w+\":\{\"\w+\":\"\w+\"\}\})"|fields my_json|spath input=my_json
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above filed extraction is taken from Splunk field extraction and needs to be tuned for your specific requirement&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2016 10:00:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-Json-string-from-log-event/m-p/234210#M99040</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-08-22T10:00:51Z</dc:date>
    </item>
  </channel>
</rss>

