<?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: Why is Splunk assigning the same and wrong timestamp to thousands of indexed events? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139963#M28760</link>
    <description>&lt;P&gt;Just add TIME_FORMAT in  your props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %Y-%m-%dT%H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Jul 2015 18:03:41 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2015-07-28T18:03:41Z</dc:date>
    <item>
      <title>Why is Splunk assigning the same and wrong timestamp to thousands of indexed events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139962#M28759</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/499iA17890307A9AA3F4/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;Splunk n00b here.&lt;/P&gt;

&lt;P&gt;Our Splunk system was recently indexing the wrong timestamp. I made some alterations to props.conf and now I get thousands of logs indexed at the same time even though the time within the actual logs (ie the timestamp in the log itself rather than the Splunk timestamp) are completely different.&lt;/P&gt;

&lt;P&gt;Here's an extract from my props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
CHARSET = UTF-8
LINE_BREAKER_LOOKBEHIND = 100
TRUNCATE = 10000
DATETIME_CONFIG = datetime.xml
ANNOTATE_PUNCT = True
HEADER_MODE =
MAX_DAYS_HENCE=2
MAX_DAYS_AGO=2000
MAX_DIFF_SECS_AGO=3600
MAX_DIFF_SECS_HENCE=604800
MAX_TIMESTAMP_LOOKAHEAD = 128
SHOULD_LINEMERGE = True
BREAK_ONLY_BEFORE =
BREAK_ONLY_BEFORE_DATE = True
MAX_EVENTS = 256
MUST_BREAK_AFTER =
MUST_NOT_BREAK_AFTER =
MUST_NOT_BREAK_BEFORE =
TRANSFORMS =
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 10:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139962#M28759</guid>
      <dc:creator>ben_davies2</dc:creator>
      <dc:date>2015-07-28T10:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk assigning the same and wrong timestamp to thousands of indexed events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139963#M28760</link>
      <description>&lt;P&gt;Just add TIME_FORMAT in  your props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %Y-%m-%dT%H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 18:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139963#M28760</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-07-28T18:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk assigning the same and wrong timestamp to thousands of indexed events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139964#M28761</link>
      <description>&lt;P&gt;The fact that this is in a default stanza is kind of scary.  Whatever you set in default is going to apply to &lt;EM&gt;everything&lt;/EM&gt; that doesn't have explicit overrides, and could break a lot of configs that assume defaults.  Create a stanza for this sourcetype and place configurations there.  &lt;/P&gt;

&lt;P&gt;That said, looking at the logs, this should be a pretty straightforward config:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
SHOULD_LINEMERGE=false
LINE_BREAKER=([\r\n]+)(?:\d{4}-\d{2}-\d{2})
TIME_PREFIX=^
MAX_TIMESTAMP_LOOKAHEAD=25
TIME_FORMAT=%FT%T%z
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This tells Splunk exactly where to split events, tells it exactly where to find the timestamp, and tells it exactly how the timestamp is formatted.  It can usually figure this stuff out itself, but explicitly defining it makes parsing more efficient, and should be done wherever possible.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 18:20:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139964#M28761</guid>
      <dc:creator>emiller42</dc:creator>
      <dc:date>2015-07-28T18:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Splunk assigning the same and wrong timestamp to thousands of indexed events?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139965#M28762</link>
      <description>&lt;P&gt;The problem is that Splunk cannot find a timestamp (because you are not correctly telling it how to do so) so it is defaulting to the last timestamp it has from this sourcetype.  You will find error logs that say something like "cannot identify timestamp; defaulting to timestamp of previous event".&lt;/P&gt;

&lt;P&gt;There is a scoping problem in that you are using a &lt;CODE&gt;[default]&lt;/CODE&gt; stanza instead of one specifically targeted to your events so let's fix that first.  I assume this means that you are editing &lt;CODE&gt;$SPLUNK_HOME/etc/system/local/props.conf&lt;/CODE&gt; which is an exceedingly poor decision for many reasons.  Pick a name for your thing like &lt;CODE&gt;MyApp&lt;/CODE&gt; and create a directory structure like this &lt;CODE&gt;$SPLUNK_HOME/etc/apps/MyApp/default&lt;/CODE&gt;.  Inside this, create a &lt;CODE&gt;props.conf&lt;/CODE&gt; file with these settings (instead of &lt;CODE&gt;myAppSourcetype&lt;/CODE&gt;, use whatever you specified in &lt;CODE&gt;sourcetype=&lt;/CODE&gt; inside of your &lt;CODE&gt;inputs.conf&lt;/CODE&gt; file, which should also be moved into the same `MyApp directory structure (but on the Forwarders instead of the Indexers):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[myAppSourcetype]
SHOULD_LINEMERGE=false
TIME_PREFIX=^
TIME_FORMAT = %Y-%m-%dT%H:%M:%S%z
MAX_TIMESTAMP_LOOKAHEAD=20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Deploy this to all of your Indexers and restart all of their Splunk instances.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2015 00:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-Splunk-assigning-the-same-and-wrong-timestamp-to/m-p/139965#M28762</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-29T00:00:01Z</dc:date>
    </item>
  </channel>
</rss>

