<?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 Parsing XML and props.conf help in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263#M32076</link>
    <description>&lt;P&gt;Let me first preface this by saying that I am a total Splunk newbie and this is very similar to a lot of XML parsing questions, however I have read through ~20 topics and am still unable to get my XML log to parse properly.&lt;/P&gt;

&lt;P&gt;Here is a sample of my XML file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Customers&amp;gt;
    &amp;lt;customer&amp;gt;
        &amp;lt;customerName&amp;gt;SampleCustomer1&amp;lt;/customerName&amp;gt;
        &amp;lt;siteName&amp;gt;Main&amp;lt;/siteName&amp;gt;
        &amp;lt;lastUpdated&amp;gt;8/10/2015 8:09:51 AM&amp;lt;/lastUpdated&amp;gt;
        &amp;lt;alarmedState&amp;gt;False&amp;lt;/alarmedState&amp;gt;
        &amp;lt;updateFrequency&amp;gt;45&amp;lt;/updateFrequency&amp;gt;
        &amp;lt;pointsNotCommunicating&amp;gt;
            &amp;lt;pointNotCommunicating&amp;gt;SamplePoint1@2015-07-02 17:07:00&amp;lt;/pointNotCommunicating&amp;gt;
            &amp;lt;totalNotCommunicating&amp;gt;1&amp;lt;/totalNotCommunicating&amp;gt;
        &amp;lt;/pointsNotCommunicating&amp;gt;
        &amp;lt;ClientIsUp&amp;gt;true&amp;lt;/ClientIsUp&amp;gt;
    &amp;lt;/customer&amp;gt;
    &amp;lt;customer&amp;gt;
        &amp;lt;customerName&amp;gt;SampleCustomer2&amp;lt;/customerName&amp;gt;
        &amp;lt;siteName&amp;gt;Main&amp;lt;/siteName&amp;gt;
        &amp;lt;lastUpdated&amp;gt;8/10/2015 8:27:57 AM&amp;lt;/lastUpdated&amp;gt;
        &amp;lt;alarmedState&amp;gt;False&amp;lt;/alarmedState&amp;gt;
        &amp;lt;updateFrequency&amp;gt;30&amp;lt;/updateFrequency&amp;gt;
        &amp;lt;pointsNotCommunicating&amp;gt;
            &amp;lt;totalNotCommunicating&amp;gt;0&amp;lt;/totalNotCommunicating&amp;gt;
        &amp;lt;/pointsNotCommunicating&amp;gt;
        &amp;lt;ClientIsUp&amp;gt;true&amp;lt;/ClientIsUp&amp;gt;
    &amp;lt;/customer&amp;gt;

&amp;lt;/Customers&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First: What I did was create a new file called props.conf in my splunk directory under .../etc/system/local   because there wasn't a props.conf file there.  Here is the entire contents of my props.conf file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::C:\\Program Files (x86)\\SkySparkServer\\serverStatus.xml]
sourcetype: SkySparkLog

[SkySparkLog]
KV_MODE=xml
TIME_PREFIX = &amp;lt;lastUpdated&amp;gt;
TIME_FORMAT = %m\/%d\/%Y %I:%M:%S
SHOULD_LINEMERGE = true
MUST_NOT_BREAK_BEFORE = \&amp;lt;/pointsNotCommunicating\&amp;gt;
MUST_BREAK_AFTER = \&amp;lt;/customer\&amp;gt;
TRUNCATE = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this the proper method and if so, am I doing something wrong in my props.conf file?  &lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2015 14:48:57 GMT</pubDate>
    <dc:creator>jtashker</dc:creator>
    <dc:date>2015-08-10T14:48:57Z</dc:date>
    <item>
      <title>Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263#M32076</link>
      <description>&lt;P&gt;Let me first preface this by saying that I am a total Splunk newbie and this is very similar to a lot of XML parsing questions, however I have read through ~20 topics and am still unable to get my XML log to parse properly.&lt;/P&gt;

&lt;P&gt;Here is a sample of my XML file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;Customers&amp;gt;
    &amp;lt;customer&amp;gt;
        &amp;lt;customerName&amp;gt;SampleCustomer1&amp;lt;/customerName&amp;gt;
        &amp;lt;siteName&amp;gt;Main&amp;lt;/siteName&amp;gt;
        &amp;lt;lastUpdated&amp;gt;8/10/2015 8:09:51 AM&amp;lt;/lastUpdated&amp;gt;
        &amp;lt;alarmedState&amp;gt;False&amp;lt;/alarmedState&amp;gt;
        &amp;lt;updateFrequency&amp;gt;45&amp;lt;/updateFrequency&amp;gt;
        &amp;lt;pointsNotCommunicating&amp;gt;
            &amp;lt;pointNotCommunicating&amp;gt;SamplePoint1@2015-07-02 17:07:00&amp;lt;/pointNotCommunicating&amp;gt;
            &amp;lt;totalNotCommunicating&amp;gt;1&amp;lt;/totalNotCommunicating&amp;gt;
        &amp;lt;/pointsNotCommunicating&amp;gt;
        &amp;lt;ClientIsUp&amp;gt;true&amp;lt;/ClientIsUp&amp;gt;
    &amp;lt;/customer&amp;gt;
    &amp;lt;customer&amp;gt;
        &amp;lt;customerName&amp;gt;SampleCustomer2&amp;lt;/customerName&amp;gt;
        &amp;lt;siteName&amp;gt;Main&amp;lt;/siteName&amp;gt;
        &amp;lt;lastUpdated&amp;gt;8/10/2015 8:27:57 AM&amp;lt;/lastUpdated&amp;gt;
        &amp;lt;alarmedState&amp;gt;False&amp;lt;/alarmedState&amp;gt;
        &amp;lt;updateFrequency&amp;gt;30&amp;lt;/updateFrequency&amp;gt;
        &amp;lt;pointsNotCommunicating&amp;gt;
            &amp;lt;totalNotCommunicating&amp;gt;0&amp;lt;/totalNotCommunicating&amp;gt;
        &amp;lt;/pointsNotCommunicating&amp;gt;
        &amp;lt;ClientIsUp&amp;gt;true&amp;lt;/ClientIsUp&amp;gt;
    &amp;lt;/customer&amp;gt;

&amp;lt;/Customers&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First: What I did was create a new file called props.conf in my splunk directory under .../etc/system/local   because there wasn't a props.conf file there.  Here is the entire contents of my props.conf file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::C:\\Program Files (x86)\\SkySparkServer\\serverStatus.xml]
sourcetype: SkySparkLog

[SkySparkLog]
KV_MODE=xml
TIME_PREFIX = &amp;lt;lastUpdated&amp;gt;
TIME_FORMAT = %m\/%d\/%Y %I:%M:%S
SHOULD_LINEMERGE = true
MUST_NOT_BREAK_BEFORE = \&amp;lt;/pointsNotCommunicating\&amp;gt;
MUST_BREAK_AFTER = \&amp;lt;/customer\&amp;gt;
TRUNCATE = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this the proper method and if so, am I doing something wrong in my props.conf file?  &lt;/P&gt;

&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 14:48:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263#M32076</guid>
      <dc:creator>jtashker</dc:creator>
      <dc:date>2015-08-10T14:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158264#M32077</link>
      <description>&lt;P&gt;I believe you should change the following lines.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %m\/%d\/%Y %I:%M:%S %p
MUST_BREAK_AFTER = \&amp;lt;/Customers\&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2015 15:55:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158264#M32077</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-10T15:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158265#M32078</link>
      <description>&lt;P&gt;Rich, thank you for your reply.  I will change TIME_FORMAT to match, but I don't think I want to break after /Customers.&lt;/P&gt;

&lt;P&gt;I really want each customer to be one entry.  Am I thinking about this the wrong way?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158265#M32078</guid>
      <dc:creator>jtashker</dc:creator>
      <dc:date>2015-08-10T16:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158266#M32079</link>
      <description>&lt;P&gt;I see where breaking where you want makes sense.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 16:50:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158266#M32079</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-10T16:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158267#M32080</link>
      <description>&lt;P&gt;Try this under your sourcetype definition in props.conf on Indexer/Heavy forwarder.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [SkySparkLog]
KV_MODE=xml
TRUNCATE = 0
TIME_PREFIX = \&amp;lt;lastUpdated\&amp;gt;
SHOULD_LINEMERGE = true
TIME_FORMAT = %m/%d/%Y %I:%M:%S
LINE_BREAKER = (&amp;lt;customer&amp;gt;)
MUST_BREAK_AFTER = \&amp;lt;/customer\&amp;gt;
SEDCMD-acrRemover = s/\x0D//g
SEDCMD-blfRemover = s/\x0A//g
SEDCMD-abremoveheader = s/\&amp;lt;\?xml.*\s*\&amp;lt;Customers\&amp;gt;\s*//g
SEDCMD-bremovefooter = s/\&amp;lt;\/Customers\&amp;gt;//
SEDCMD-caddroot = s/(.*)/&amp;lt;customer&amp;gt;\1/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Aug 2015 17:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158267#M32080</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-10T17:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158268#M32081</link>
      <description>&lt;P&gt;This works, thank you.  Can you explain what the SEDCMD fields are doing? &lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 17:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158268#M32081</guid>
      <dc:creator>jtashker</dc:creator>
      <dc:date>2015-08-10T17:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing XML and props.conf help</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158269#M32082</link>
      <description>&lt;P&gt;Its just removing the unwanted strings from you xml. Thexml header, the root Customers tag and newline and tabs, so youd get individual customer tag with proper xml syntax.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2015 17:45:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158269#M32082</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-10T17:45:57Z</dc:date>
    </item>
  </channel>
</rss>

