<?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 How to extract sub-element data from a JSON message: In the event below, i want to extract from MessageBody, the subdata under Request like businessId, partnerEBID and also some fields from the Response section like branchCode in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358027#M65369</link>
    <description>&lt;P&gt;{&lt;BR /&gt;&lt;BR /&gt;
     cid:    abcde&lt;BR /&gt;&lt;BR /&gt;
     d:  1211&lt;BR /&gt;&lt;BR /&gt;
     environment:    nonProd&lt;BR /&gt;&lt;BR /&gt;
     log:    request&lt;BR /&gt;&lt;BR /&gt;
     messageBody:&lt;BR /&gt;&lt;BR /&gt;
}&lt;/P&gt;</description>
    <pubDate>Sun, 18 Mar 2018 14:45:58 GMT</pubDate>
    <dc:creator>besa0903</dc:creator>
    <dc:date>2018-03-18T14:45:58Z</dc:date>
    <item>
      <title>How to extract sub-element data from a JSON message: In the event below, i want to extract from MessageBody, the subdata under Request like businessId, partnerEBID and also some fields from the Response section like branchCode</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358027#M65369</link>
      <description>&lt;P&gt;{&lt;BR /&gt;&lt;BR /&gt;
     cid:    abcde&lt;BR /&gt;&lt;BR /&gt;
     d:  1211&lt;BR /&gt;&lt;BR /&gt;
     environment:    nonProd&lt;BR /&gt;&lt;BR /&gt;
     log:    request&lt;BR /&gt;&lt;BR /&gt;
     messageBody:&lt;BR /&gt;&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Sun, 18 Mar 2018 14:45:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358027#M65369</guid>
      <dc:creator>besa0903</dc:creator>
      <dc:date>2018-03-18T14:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract sub-element data from a JSON message: In the event below, i want to extract from MessageBody, the subdata under Request like businessId, partnerEBID and also some fields from the Response section like branchCode</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358028#M65370</link>
      <description>&lt;P&gt;This should be a straight forward regular expression extract.  Some of the formatting of your JSON looks strange though, with strange characters in it like where the "∂" where I think you expected "partnerEBID" to be.  I also don't see a branchCode but I do see a brandCode. I'm not a JSON expert but that value for the brandCode doesn't look like valid JSON to me.  If the value is supposed to be an empty string, it should be 2 sets of double quotes, not just 1.  Anyway, with the data provided, I created a very simple regular expression.  I'm sure there are better ways to write it but this is the easiest thing that works.  I think you can extrapolate from here to extract more fields with this expression.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "businessId=(?P&amp;lt;businessId&amp;gt;\d+).*EBID=(?P&amp;lt;partnerEBID&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Mar 2018 02:39:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358028#M65370</guid>
      <dc:creator>FeatureCreeep</dc:creator>
      <dc:date>2018-03-19T02:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract sub-element data from a JSON message: In the event below, i want to extract from MessageBody, the subdata under Request like businessId, partnerEBID and also some fields from the Response section like branchCode</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358029#M65371</link>
      <description>&lt;P&gt;Great, thanks a bunch. It works like a charm.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 19:14:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-sub-element-data-from-a-JSON-message-In-the-event/m-p/358029#M65371</guid>
      <dc:creator>besa0903</dc:creator>
      <dc:date>2018-03-19T19:14:49Z</dc:date>
    </item>
  </channel>
</rss>

