<?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 can I add and parse the XML data into Splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-add-and-parse-the-XML-data-into-Splunk/m-p/447974#M77911</link>
    <description>&lt;P&gt;Hello @vidhyaArumalla, &lt;/P&gt;

&lt;P&gt;Based on the sample data, below configuration should get you started. &lt;/P&gt;

&lt;P&gt;Please note that, I am using &lt;CODE&gt;DATETIME_CONFIG = NONE&lt;/CODE&gt; setting because, there is no timestamp available in the sample data. If this is the case with real data, this setting will leave the event time set to whatever time was selected by the input layer(for ex: Universal forwarder). If timestamp is available in data, then you should use &lt;CODE&gt;TIME_FORMAT &amp;amp; TIME_PREFIX&lt;/CODE&gt; settings to explicitly extract timestamps. Let me know if this helps.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/Admin/Propsconf"&gt;Props.conf&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[custom_sourcetype_XML]
KV_MODE = xml
LINE_BREAKER = ([\r\n]+)\&amp;lt;result\&amp;gt;
SHOULD_LINEMERGE = false
DATETIME_CONFIG = NONE
EXTRACT-State = \&amp;lt;u\_State\&amp;gt;\s*\&amp;lt;display\_value\&amp;gt;(?&amp;lt;State&amp;gt;\w+)\&amp;lt;\/
EXTRACT-City = \&amp;lt;u\_city\&amp;gt;\s*\&amp;lt;display\_value\&amp;gt;(?&amp;lt;City&amp;gt;\w+)\&amp;lt;\/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 19 Jul 2018 16:29:35 GMT</pubDate>
    <dc:creator>sudosplunk</dc:creator>
    <dc:date>2018-07-19T16:29:35Z</dc:date>
    <item>
      <title>How can I add and parse the XML data into Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-add-and-parse-the-XML-data-into-Splunk/m-p/447973#M77910</link>
      <description>&lt;P&gt;I am getting an XML of below format&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;result&amp;gt;
    &amp;lt;attribute&amp;gt;
    &amp;lt;display_value/&amp;gt;
    &amp;lt;value/&amp;gt;
    &amp;lt;/attribute&amp;gt;
    &amp;lt;u_State&amp;gt;
        &amp;lt;display_value&amp;gt;Georgia&amp;lt;/display_value&amp;gt;
        &amp;lt;value&amp;gt;Georgia&amp;lt;/value&amp;gt;
    &amp;lt;/u_State&amp;gt;
    &amp;lt;u_city&amp;gt;
        &amp;lt;display_value&amp;gt;Atlanta&amp;lt;/display_value&amp;gt;
        &amp;lt;value&amp;gt;Atlanta&amp;lt;/value&amp;gt;
    &amp;lt;/u_city&amp;gt;
    &amp;lt;u_supplier_name&amp;gt;
    &amp;lt;display_value/&amp;gt;
    &amp;lt;value/&amp;gt;
&amp;lt;/result&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I found a solution at &lt;A href="https://answers.splunk.com/answers/187195/how-to-add-and-parse-xml-data-in-splunk.html"&gt;https://answers.splunk.com/answers/187195/how-to-add-and-parse-xml-data-in-splunk.html&lt;/A&gt; but is not helping me with mentioned xml format for field extractions during data ingestion.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 20:58:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-add-and-parse-the-XML-data-into-Splunk/m-p/447973#M77910</guid>
      <dc:creator>vidhyaArumalla</dc:creator>
      <dc:date>2018-07-18T20:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I add and parse the XML data into Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-add-and-parse-the-XML-data-into-Splunk/m-p/447974#M77911</link>
      <description>&lt;P&gt;Hello @vidhyaArumalla, &lt;/P&gt;

&lt;P&gt;Based on the sample data, below configuration should get you started. &lt;/P&gt;

&lt;P&gt;Please note that, I am using &lt;CODE&gt;DATETIME_CONFIG = NONE&lt;/CODE&gt; setting because, there is no timestamp available in the sample data. If this is the case with real data, this setting will leave the event time set to whatever time was selected by the input layer(for ex: Universal forwarder). If timestamp is available in data, then you should use &lt;CODE&gt;TIME_FORMAT &amp;amp; TIME_PREFIX&lt;/CODE&gt; settings to explicitly extract timestamps. Let me know if this helps.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.1.2/Admin/Propsconf"&gt;Props.conf&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[custom_sourcetype_XML]
KV_MODE = xml
LINE_BREAKER = ([\r\n]+)\&amp;lt;result\&amp;gt;
SHOULD_LINEMERGE = false
DATETIME_CONFIG = NONE
EXTRACT-State = \&amp;lt;u\_State\&amp;gt;\s*\&amp;lt;display\_value\&amp;gt;(?&amp;lt;State&amp;gt;\w+)\&amp;lt;\/
EXTRACT-City = \&amp;lt;u\_city\&amp;gt;\s*\&amp;lt;display\_value\&amp;gt;(?&amp;lt;City&amp;gt;\w+)\&amp;lt;\/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Jul 2018 16:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-add-and-parse-the-XML-data-into-Splunk/m-p/447974#M77911</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-19T16:29:35Z</dc:date>
    </item>
  </channel>
</rss>

