<?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 do I assign a single timestamp to multiple events in one XML document at index-time? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154053#M31318</link>
    <description>&lt;P&gt;I don't know of any way to do this outside of pre-processing it.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Aug 2015 14:55:25 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-08-04T14:55:25Z</dc:date>
    <item>
      <title>How do I assign a single timestamp to multiple events in one XML document at index-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154052#M31317</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I have an XML feed that returns data like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;feed lastUpdate="1438698061185" version="2.0"&amp;gt;

&amp;lt;doc&amp;gt;
&amp;lt;num&amp;gt;1&amp;lt;/num&amp;gt;
&amp;lt;num2&amp;gt;13&amp;lt;/num2&amp;gt;
&amp;lt;/doc&amp;gt;

&amp;lt;doc&amp;gt;
&amp;lt;num&amp;gt;1&amp;lt;/num&amp;gt;
&amp;lt;num2&amp;gt;13&amp;lt;/num2&amp;gt;
&amp;lt;/doc&amp;gt;

&amp;lt;/feed&amp;gt; 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see, the timestamp (lastUpdate=) is at the top of the document, which contains 2 events (in this example). The actual doc is much larger (1000+ events), so trying to avoid splitting events at search time (using spath).&lt;/P&gt;

&lt;P&gt;Is there any way I can assign this time to each event at index time? Or do I need to pre-process the XML doc?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:36:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154052#M31317</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-08-04T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I assign a single timestamp to multiple events in one XML document at index-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154053#M31318</link>
      <description>&lt;P&gt;I don't know of any way to do this outside of pre-processing it.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 14:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154053#M31318</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-04T14:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I assign a single timestamp to multiple events in one XML document at index-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154054#M31319</link>
      <description>&lt;P&gt;Agreed, you would have to pre-process the xml file before dropping it to monitored folder OR you can setup a scripted input which will do this processing and send events to Splunk. &lt;/P&gt;

&lt;P&gt;How much delay you see between the value in header-lastUpdate versus time when files is dropped to monitored folder?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 16:49:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154054#M31319</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-08-04T16:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I assign a single timestamp to multiple events in one XML document at index-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154055#M31320</link>
      <description>&lt;P&gt;You have 2 options:&lt;/P&gt;

&lt;P&gt;1: If the dumping of the data is in near-realtime, you can use &lt;CODE&gt;DATETIME_CONFIG = CURRENT&lt;/CODE&gt; which will cause Splunk to timestamp your event with the Indexer's current system time (so that _time = _indextime).&lt;/P&gt;

&lt;P&gt;2: Configure linebreaking and  timestamping in the normal way and, believe it or not, it will actually work as you would like but the downside is you will get a huge number of logs like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014 22:22:16.138 +0000 WARN  DateParserVerbose - Failed to parse timestamp. Defaulting to timestamp of previous event (Wed Oct 22 22:22:14 2014). Context: source::XXX|host::YYY|ZZZ|3549
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because it defaults to the timestamp of the previous event: WIN!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 16:58:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154055#M31320</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-04T16:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I assign a single timestamp to multiple events in one XML document at index-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154056#M31321</link>
      <description>&lt;P&gt;Oh! This is really interesting, I did not know of that behaviour.&lt;/P&gt;

&lt;P&gt;I could use index time for timestamp for this use case, however, was just checking if I had missed something. This is super useful to know. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 19:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154056#M31321</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-08-04T19:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I assign a single timestamp to multiple events in one XML document at index-time?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154057#M31322</link>
      <description>&lt;P&gt;Thought so. I could use index time for timestamp for this use case, however, was just checking if I had missed something Splunk could have done.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Aug 2015 19:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-assign-a-single-timestamp-to-multiple-events-in-one-XML/m-p/154057#M31322</guid>
      <dc:creator>himynamesdave</dc:creator>
      <dc:date>2015-08-04T19:01:59Z</dc:date>
    </item>
  </channel>
</rss>

