<?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 extract fields from json wrapped inside a XML data in Security</title>
    <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379982#M9346</link>
    <description>&lt;P&gt;Thanks for working on it, It was not able to extract the serviceName and conversationID from MessageBody into the table...if you did, can you send me the query. [ make sure the serviceName and conversationID is extracted form the MesageBody]&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 16:54:47 GMT</pubDate>
    <dc:creator>besa0903</dc:creator>
    <dc:date>2018-06-11T16:54:47Z</dc:date>
    <item>
      <title>How to extract fields from json wrapped inside a XML data</title>
      <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379980#M9344</link>
      <description>&lt;P&gt;how  to display fields in a table from the json embedded in the xml.&lt;/P&gt;

&lt;P&gt;I tried spath and rex but to no luck.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 14:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379980#M9344</guid>
      <dc:creator>besa0903</dc:creator>
      <dc:date>2018-06-11T14:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from json wrapped inside a XML data</title>
      <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379981#M9345</link>
      <description>&lt;P&gt;Hi Besa0903,&lt;/P&gt;

&lt;P&gt;I brought your data into my own splunk env and used spath - I can see serviceName extracted properly, while conversationID is set to null. If you run your search like this, do you see serviceName and other fields extracted from the json blob?&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=datapower host=mq-tst sourcetype=mq ServiceName=SC_GLOBAL_B2B_GenericSplunkLogger_MPGW *error*&lt;BR /&gt;
 | spath&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 16:24:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379981#M9345</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2018-06-11T16:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from json wrapped inside a XML data</title>
      <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379982#M9346</link>
      <description>&lt;P&gt;Thanks for working on it, It was not able to extract the serviceName and conversationID from MessageBody into the table...if you did, can you send me the query. [ make sure the serviceName and conversationID is extracted form the MesageBody]&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 16:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379982#M9346</guid>
      <dc:creator>besa0903</dc:creator>
      <dc:date>2018-06-11T16:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from json wrapped inside a XML data</title>
      <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379983#M9347</link>
      <description>&lt;P&gt;Upon further inspection - there's some inconsistency to the formatting of the data (which is why spath won't quite work in this case.) I put together a janky search string that gets you the conversationId and serviceName - but it won't pick up field names/values out of the second half of your messageBody until the formatting is fixed..&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=datapower host=mq-tst sourcetype=mq ServiceName=SC_GLOBAL_B2B_GenericSplunkLogger_MPGW *error* &lt;BR /&gt;
|spath &lt;BR /&gt;
| spath input="MessageViewer.MessageBody"&lt;BR /&gt;
| table conversationID, serviceName&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 21:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379983#M9347</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2018-06-11T21:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from json wrapped inside a XML data</title>
      <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379984#M9348</link>
      <description>&lt;P&gt;hello jluo, can you help me undestand how to fix the format or point to where the inconistency is.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 14:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379984#M9348</guid>
      <dc:creator>besa0903</dc:creator>
      <dc:date>2018-06-12T14:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from json wrapped inside a XML data</title>
      <link>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379985#M9349</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;\nhttps://acs2-dealer-orders-api.mcf-np.local/orderChangeLog?soldToPartnerId=0001662715&amp;amp;soldToPartnerIdType=SAP&amp;amp;seedYear=2018\n{\"headers\":{},\"body\":{\"dealerOrderChangeLogResponseEntityList\":[{\"soldToPartnerEBID\":\"1100027381904\",\"soldToPartnerGLNID\":\"1100027381904\",\"soldToPartnerSAPID\":\"0001662715\",\"soldToPartnerName\":\"MFA BOONVILLE MO\",\"soldToPartnerAddress\":\"1605 RADIO HILL ROAD\",\"sellerPartnerId\":\"0062668030000\",\"sellerPartnerIdType\":\"EBID\",\"requestingSource\":\"\",\"seedYear\":\"2018\",\"requestType\":\"LOG\",\"buyerId\":\"0001662715\",\"sellerId\":\"0062668030000\",\"dealerOrderChangeLogLineItemList\":[]}],\"apiErrors\":[],\"apiMessages\":[],\"apiResponseTimes\":{},\"requestId\":\"f325f348-48f2-4dba-5f40-a8a3f264c247\"},\"statusCode\":\"OK\",\"statusCodeValue\":200}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Starting from this section, you begin to include backslashes in the field names whereas previously you did not have them. Every now and then there's a line break (\n) but it's not quite clear when/why they are sometimes included?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"messageBody":"https://acs2-dealer-orders-api.mcf-np.local/orderChangeLog?soldToPartnerId=0001662715&amp;amp;soldToPartnerIdType=SAP&amp;amp;seedYear=2018host = acs2-dealer-orders-api.mcf-np.local
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this snippet, there are missing ampersands so the host actually isn't extracted properly because it's viewed as part of the seedYear.&lt;/P&gt;

&lt;P&gt;Besa0903, if you were able to get the query working, could you accept this as your answer?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 16:04:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-to-extract-fields-from-json-wrapped-inside-a-XML-data/m-p/379985#M9349</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2018-06-12T16:04:35Z</dc:date>
    </item>
  </channel>
</rss>

