<?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 configure XML data parsing? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279706#M53525</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've not tried to parse XML data in Splunk so I need a bit of hand holding....  I have the following data that repeats for different sensors.  I'd like to be able to extract all the XML fields.  I know this needs to be done in props.conf (and maybe transforms.conf) but I don't know where to begin :)....  Any help would be GREATLY appreciated!  TY!!!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;!--Crow Sensors Begin--&amp;gt;
    &amp;lt;DeviceDescriptor&amp;gt;
        &amp;lt;uuid&amp;gt;4434D720-A9E7-11E3-9CF2-0002A5D5C51B&amp;lt;/uuid&amp;gt;
        &amp;lt;description&amp;gt;Flood Sensor&amp;lt;/description&amp;gt;
        &amp;lt;category&amp;gt;zigbee&amp;lt;/category&amp;gt;
        &amp;lt;manufacturer&amp;gt;Crow&amp;lt;/manufacturer&amp;gt;
        &amp;lt;model&amp;gt;FLOOD-ZB&amp;lt;/model&amp;gt;
        &amp;lt;hardwareVersions&amp;gt;0x1C&amp;lt;/hardwareVersions&amp;gt;
        &amp;lt;firmwareVersions&amp;gt;0x01000025&amp;lt;/firmwareVersions&amp;gt;
        &amp;lt;latestFirmware&amp;gt;
            &amp;lt;version&amp;gt;0x01000025&amp;lt;/version&amp;gt;
            &amp;lt;filename&amp;gt;crow-flood-zb-v1.0.25.ota&amp;lt;/filename&amp;gt;
            &amp;lt;type&amp;gt;ota&amp;lt;/type&amp;gt;
        &amp;lt;/latestFirmware&amp;gt;
    &amp;lt;/DeviceDescriptor&amp;gt;

    &amp;lt;DeviceDescriptor&amp;gt;
        &amp;lt;uuid&amp;gt;4b931971-bf2a-11e3-b1b6-0800200c9a66&amp;lt;/uuid&amp;gt;
        &amp;lt;description&amp;gt;Motion (PIR) Sensor&amp;lt;/description&amp;gt;
        &amp;lt;category&amp;gt;zigbee&amp;lt;/category&amp;gt;
        &amp;lt;manufacturer&amp;gt;Crow&amp;lt;/manufacturer&amp;gt;
        &amp;lt;model&amp;gt;PIR-ZB&amp;lt;/model&amp;gt;
        &amp;lt;hardwareVersions&amp;gt;0x1A&amp;lt;/hardwareVersions&amp;gt;
        &amp;lt;firmwareVersions&amp;gt;0x01000025&amp;lt;/firmwareVersions&amp;gt;
        &amp;lt;latestFirmware&amp;gt;
            &amp;lt;version&amp;gt;0x01000025&amp;lt;/version&amp;gt;
            &amp;lt;filename&amp;gt;crow-pir-zb-v1.0.25.ota&amp;lt;/filename&amp;gt;
            &amp;lt;type&amp;gt;ota&amp;lt;/type&amp;gt;
        &amp;lt;/latestFirmware&amp;gt;
    &amp;lt;/DeviceDescriptor&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Feb 2017 20:59:43 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2017-02-06T20:59:43Z</dc:date>
    <item>
      <title>How to configure XML data parsing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279706#M53525</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've not tried to parse XML data in Splunk so I need a bit of hand holding....  I have the following data that repeats for different sensors.  I'd like to be able to extract all the XML fields.  I know this needs to be done in props.conf (and maybe transforms.conf) but I don't know where to begin :)....  Any help would be GREATLY appreciated!  TY!!!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;!--Crow Sensors Begin--&amp;gt;
    &amp;lt;DeviceDescriptor&amp;gt;
        &amp;lt;uuid&amp;gt;4434D720-A9E7-11E3-9CF2-0002A5D5C51B&amp;lt;/uuid&amp;gt;
        &amp;lt;description&amp;gt;Flood Sensor&amp;lt;/description&amp;gt;
        &amp;lt;category&amp;gt;zigbee&amp;lt;/category&amp;gt;
        &amp;lt;manufacturer&amp;gt;Crow&amp;lt;/manufacturer&amp;gt;
        &amp;lt;model&amp;gt;FLOOD-ZB&amp;lt;/model&amp;gt;
        &amp;lt;hardwareVersions&amp;gt;0x1C&amp;lt;/hardwareVersions&amp;gt;
        &amp;lt;firmwareVersions&amp;gt;0x01000025&amp;lt;/firmwareVersions&amp;gt;
        &amp;lt;latestFirmware&amp;gt;
            &amp;lt;version&amp;gt;0x01000025&amp;lt;/version&amp;gt;
            &amp;lt;filename&amp;gt;crow-flood-zb-v1.0.25.ota&amp;lt;/filename&amp;gt;
            &amp;lt;type&amp;gt;ota&amp;lt;/type&amp;gt;
        &amp;lt;/latestFirmware&amp;gt;
    &amp;lt;/DeviceDescriptor&amp;gt;

    &amp;lt;DeviceDescriptor&amp;gt;
        &amp;lt;uuid&amp;gt;4b931971-bf2a-11e3-b1b6-0800200c9a66&amp;lt;/uuid&amp;gt;
        &amp;lt;description&amp;gt;Motion (PIR) Sensor&amp;lt;/description&amp;gt;
        &amp;lt;category&amp;gt;zigbee&amp;lt;/category&amp;gt;
        &amp;lt;manufacturer&amp;gt;Crow&amp;lt;/manufacturer&amp;gt;
        &amp;lt;model&amp;gt;PIR-ZB&amp;lt;/model&amp;gt;
        &amp;lt;hardwareVersions&amp;gt;0x1A&amp;lt;/hardwareVersions&amp;gt;
        &amp;lt;firmwareVersions&amp;gt;0x01000025&amp;lt;/firmwareVersions&amp;gt;
        &amp;lt;latestFirmware&amp;gt;
            &amp;lt;version&amp;gt;0x01000025&amp;lt;/version&amp;gt;
            &amp;lt;filename&amp;gt;crow-pir-zb-v1.0.25.ota&amp;lt;/filename&amp;gt;
            &amp;lt;type&amp;gt;ota&amp;lt;/type&amp;gt;
        &amp;lt;/latestFirmware&amp;gt;
    &amp;lt;/DeviceDescriptor&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2017 20:59:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279706#M53525</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-02-06T20:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure XML data parsing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279707#M53526</link>
      <description>&lt;P&gt;Is the data already indexed in Splunk? If yes, then does each of DeviceDescriptor entry is coming as separate event or single event?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 22:01:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279707#M53526</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-06T22:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure XML data parsing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279708#M53527</link>
      <description>&lt;P&gt;Hi Somesoni2!   &lt;/P&gt;

&lt;P&gt;No, the data has not been indexed as of yet.  I can test out a couple if that would be helpful.  Let me know, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 22:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279708#M53527</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2017-02-06T22:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure XML data parsing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279709#M53528</link>
      <description>&lt;P&gt;Ok. So if the ingestion is done in such a way that each &lt;CODE&gt;&amp;lt;DeviceDescriptor&amp;gt;&lt;/CODE&gt; is a separate event in Splunk with valid xml syntax, the field extraction is as simple as adding &lt;CODE&gt;KV_MODE = xml&lt;/CODE&gt; in props.conf on Search Head(s). So, main focus should be getting the data ingested correctly.  Since your data doesn't have timestamp, I'm using current time as the _time value for the event.&lt;/P&gt;

&lt;P&gt;Try this for props.conf on your Indexer/Heavy Forwarder.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
SHOULD_LINEMERGE = false
LINE_BREAKER = ([\r\n]+)(?=\s*\&amp;lt;DeviceDescriptor\&amp;gt;)
DATETIME_CONFIG = CURRENT
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Search head props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceType]
KV_MODE =xml
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2017 22:16:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279709#M53528</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-06T22:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure XML data parsing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279710#M53529</link>
      <description>&lt;P&gt;I  am have a similar problem.  I have tried a number of other suggestion solutions.  This is the first that states the requirement  for indexer / heavy forwarder and search head configurations.  I was placing these configurations on the Universal Forwarder where the XML files are being written.   Why does the KV_MODE=xml needs to go on the search head?  We are using Splunk Cloud so this is not an option for me.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 20:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279710#M53529</guid>
      <dc:creator>HMTODD</dc:creator>
      <dc:date>2018-09-20T20:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure XML data parsing?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279711#M53530</link>
      <description>&lt;P&gt;worked for me but had to modify the linebreaker myself.  check your XML file for syntax problems as well.&lt;BR /&gt;
xmlint --noout filename.xml ; echo $? &lt;BR /&gt;
If there wasn't an error with your xml syntax, you should see result code 0 and nothing but a blank return.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 14:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-configure-XML-data-parsing/m-p/279711#M53530</guid>
      <dc:creator>bestpa</dc:creator>
      <dc:date>2019-06-21T14:12:05Z</dc:date>
    </item>
  </channel>
</rss>

