<?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 use rex to extract JSON text in &amp;quot;msg&amp;quot; keyValue pair? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269730#M81171</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;yourBaseQuery
|rex ".*,\"msg\":\"(?&amp;lt;message&amp;gt;.*)\",\"origin\""
| complete yourSearch
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 22 Oct 2016 15:55:18 GMT</pubDate>
    <dc:creator>gokadroid</dc:creator>
    <dc:date>2016-10-22T15:55:18Z</dc:date>
    <item>
      <title>How to use rex to extract JSON text in "msg" keyValue pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269728#M81169</link>
      <description>&lt;P&gt;I have a json raw string from which I have to extract the "msg" key and pair value. Can you please assist. The log line looks like below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;6&amp;gt;2015-11-26T17:00:15Z x45678fnjotq5 doe[88]: {"ddcfa_app_id":"asdkhad23423864-d987r89fsd-234234gsf-234jsfgsa","ddcfa_app_name":"paymentManagementApplication","ddcfa_org_id":"asdkhad23423864-d987r89fsd-234234gsf-234jsfgsasdas63g3664-s35d-33sfa","ddcfa_space_name":"noShowMessage","event_type":"LogMessage","level":"info","message_type":"OUT","msg":"DEBUG --- [ Msync160670] c.c.internal.pmtdev.CacheUtilBean : :: Exiting Method ---\u003e com.internal.pmtdev.cache.fetchDataFromIndexedEventsDaily()","origin":"rep","source_instance":"0","source_type":"APP","time":"2015-11-26T17:00:15Z","timestamp":1477069200012312311} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract "msg" field's "value":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DEBUG --- [ Msync160670] c.c.internal.pmtdev.CacheUtilBean : :: Exiting Method ---\u003e com.internal.pmtdev.cache.fetchDataFromIndexedEventsDaily()
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Oct 2016 03:03:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269728#M81169</guid>
      <dc:creator>kabSplunk</dc:creator>
      <dc:date>2016-10-22T03:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract JSON text in "msg" keyValue pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269729#M81170</link>
      <description>&lt;P&gt;Is this what you're looking for?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex field=_raw "msg\":\"(?P&amp;lt;msg&amp;gt;.[^\"\,\"]*)" | table msg
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Appears to work for me:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2057iAE5065D87F858711/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Oct 2016 15:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269729#M81170</guid>
      <dc:creator>adayton20</dc:creator>
      <dc:date>2016-10-22T15:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract JSON text in "msg" keyValue pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269730#M81171</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;yourBaseQuery
|rex ".*,\"msg\":\"(?&amp;lt;message&amp;gt;.*)\",\"origin\""
| complete yourSearch
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Oct 2016 15:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/269730#M81171</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2016-10-22T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract JSON text in "msg" keyValue pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/543295#M153900</link>
      <description>&lt;P&gt;Adding this for reference&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/160645"&gt;@bsrikanthreddy5&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;`|eval nowstring=strftime(now(), "%Y-%m-%d")`&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 03:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/543295#M153900</guid>
      <dc:creator>gokadroid</dc:creator>
      <dc:date>2021-03-11T03:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use rex to extract JSON text in "msg" keyValue pair?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/608468#M211557</link>
      <description>&lt;P&gt;.*"msg":"(?P&amp;lt;message&amp;gt;[^="]+).*&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 13:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-rex-to-extract-JSON-text-in-quot-msg-quot-keyValue/m-p/608468#M211557</guid>
      <dc:creator>vaizpatu</dc:creator>
      <dc:date>2022-08-05T13:59:34Z</dc:date>
    </item>
  </channel>
</rss>

