<?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: help with xml input in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172402#M34724</link>
    <description>&lt;P&gt;Thanks.   Unfortunately, it didn't work - it's creating one huge event.  &lt;/P&gt;</description>
    <pubDate>Mon, 05 Jan 2015 13:05:31 GMT</pubDate>
    <dc:creator>a212830</dc:creator>
    <dc:date>2015-01-05T13:05:31Z</dc:date>
    <item>
      <title>help with xml input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172400#M34722</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;

&lt;P&gt;I need some help with an xml input being sent via a tcp port.  &lt;/P&gt;

&lt;P&gt;Here's an example of the input:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;version&amp;gt;0003&amp;lt;/version&amp;gt;
&amp;lt;step&amp;gt;5&amp;lt;/step&amp;gt;
&amp;lt;lastupdate&amp;gt;1418232909&amp;lt;/lastupdate&amp;gt;
&amp;lt;ds&amp;gt;
    &amp;lt;name&amp;gt;memory_total_kib&amp;lt;/name&amp;gt;
    &amp;lt;type&amp;gt;GAUGE&amp;lt;/type&amp;gt;
    &amp;lt;minimal_heartbeat&amp;gt;300.0000&amp;lt;/minimal_heartbeat&amp;gt;
    &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;
    &amp;lt;max&amp;gt;Infinity&amp;lt;/max&amp;gt;
    &amp;lt;last_ds&amp;gt;268397836&amp;lt;/last_ds&amp;gt;
    &amp;lt;value&amp;gt;1181295095.6967&amp;lt;/value&amp;gt;
    &amp;lt;unknown_sec&amp;gt;0&amp;lt;/unknown_sec&amp;gt;
&amp;lt;/ds&amp;gt;
&amp;lt;ds&amp;gt;
    &amp;lt;name&amp;gt;memory_free_kib&amp;lt;/name&amp;gt;
    &amp;lt;type&amp;gt;GAUGE&amp;lt;/type&amp;gt;
    &amp;lt;minimal_heartbeat&amp;gt;300.0000&amp;lt;/minimal_heartbeat&amp;gt;
    &amp;lt;min&amp;gt;0.0&amp;lt;/min&amp;gt;
    &amp;lt;max&amp;gt;Infinity&amp;lt;/max&amp;gt;
    &amp;lt;last_ds&amp;gt;248575516&amp;lt;/last_ds&amp;gt;
    &amp;lt;value&amp;gt;1094051436.2458&amp;lt;/value&amp;gt;
    &amp;lt;unknown_sec&amp;gt;0&amp;lt;/unknown_sec&amp;gt;
&amp;lt;/ds&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I'd like to do the following: 1) create events from  opening ds tag to closing ds tag. 2) Use the timestamp that is provided to be used by all events, until the next one is sent.  3)Anything that isn't encapsulated in a  tag should be thrown out. &lt;/P&gt;

&lt;P&gt;Is this possible?  The information is coming in every minute, and is actually quite large -the sample above is only a snippet.  &lt;/P&gt;</description>
      <pubDate>Sun, 04 Jan 2015 16:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172400#M34722</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2015-01-04T16:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: help with xml input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172401#M34723</link>
      <description>&lt;P&gt;There will be an issue breaking up events at the &lt;CODE&gt;&amp;lt; ds &amp;gt;&lt;/CODE&gt; field, as it doesnt have timestamps associated within those events. Splunk really  wants to see the timestamp within each event to assign the timestamp properly. Refer to : &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Data/Configuretimestamprecognition#The_timestamp_processor"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/Data/Configuretimestamprecognition#The_timestamp_processor&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;That being said, you can try something like the below and it might work if the events are consecutive.. &lt;/P&gt;

&lt;P&gt;For your sourcetype you can try setting something like this:&lt;/P&gt;

&lt;P&gt;Props.conf....&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mysourcetype] 
  SHOULD_LINEMERGE = TRUE
  KV_MODE = xml
  TRUNCATE = 999999
  BREAK_ONLY_BEFORE = \&amp;lt;ds\&amp;gt;
  TIME_PREFIX = \&amp;lt;lastupdate\&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will need to modify that a bit I think, but it should break events at each &lt;CODE&gt;&amp;lt; ds &amp;gt;&lt;/CODE&gt; event and then extract key value pairs based on the XML. &lt;/P&gt;

&lt;P&gt;Share the results.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jan 2015 04:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172401#M34723</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-01-05T04:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: help with xml input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172402#M34724</link>
      <description>&lt;P&gt;Thanks.   Unfortunately, it didn't work - it's creating one huge event.  &lt;/P&gt;</description>
      <pubDate>Mon, 05 Jan 2015 13:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172402#M34724</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2015-01-05T13:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: help with xml input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172403#M34725</link>
      <description>&lt;P&gt;Update:  The data format above is copied and formatted via xml tidy.  The incoming data is one big stream..&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;000351418232909memory_total_kibGAUGE300.00000.0Infinity2683978361181295095.69670memory_free_kibGAUGE300.00000.0Infinity2485755161094051436.24580&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I found that if I tested against the XML tidy file, it worked (pretty much, anyway), but the non-formatted version still see it as one big event.  &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172403#M34725</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-28T18:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: help with xml input</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172404#M34726</link>
      <description>&lt;P&gt;Splunk looks at the raw data, as its coming it. And its not coming in as XML formatted in your case which will make it difficult. You'll most likely need alot of regex magic, or re-evaluate a method for getting this into Splunk. &lt;BR /&gt;
If you can dump the xml formatted data to a log file on a system, and then read it in with a Splunk file input, that would be best way to approach this. And them you arent subject to loss of in-flight data in the case Splunk is restarted / down..&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2015 05:51:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/help-with-xml-input/m-p/172404#M34726</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-01-06T05:51:45Z</dc:date>
    </item>
  </channel>
</rss>

