<?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: Timestamp recognition in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79594#M16325</link>
    <description>&lt;P&gt;If Splunk extracted your timestamp correctly, what do you mean by that it is not your event time? Do you mean that you have created a separate extraction that extracts this timestamp as a FIELD, but on top of that you want Splunk to use this as the event timestamp as well?&lt;/P&gt;

&lt;P&gt;Which timestamp does Splunk currently use for these events? If you check your splunkd.log, do you see any errors related to the timestamp extraction for this source?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Oct 2012 06:01:45 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-10-04T06:01:45Z</dc:date>
    <item>
      <title>Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79591#M16322</link>
      <description>&lt;P&gt;Hi, I have successfuly extracted a timestamp. However, I need Splunk to recognised it as the event timestamp. &lt;BR /&gt;
Please kindly guide me what should I do to achieve that. &lt;BR /&gt;
Thank you.&lt;/P&gt;

&lt;P&gt;e.g. created_time = 2012-09-26T02:59:57+0000&lt;/P&gt;

&lt;P&gt;TIME_PREFIX = created_time&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 27&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79591#M16322</guid>
      <dc:creator>elaine0102</dc:creator>
      <dc:date>2020-09-28T12:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79592#M16323</link>
      <description>&lt;P&gt;You don't really need to use the &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; unless there are other timestamps before this one in your event, or if this timestamp is located very far into the event text. Similarly you don't need to change &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt; from its default unless you have a good reason to do so.&lt;/P&gt;

&lt;P&gt;Other than that, your &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; looks fine. What are your current results with these settings?&lt;/P&gt;

&lt;P&gt;UPDATE: So, I did a second check - it seems Python's strptime (which is what Splunk uses) is pretty picky about that you need to specify how it should handle ALL of the string you want to parse. In your case, that string would be "2012-09-26T02:59:57+0000", and Python's strptime complains about the trailing "+0000":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; time.strptime("2012-09-26T02:59:57+0000","%Y-%m-%dT%H:%M:%S")
Traceback (most recent call last):
  File "&amp;lt;stdin&amp;gt;", line 1, in &amp;lt;module&amp;gt;
  File "/usr/local/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/local/lib/python2.6/_strptime.py", line 328, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: +0000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This trailing +0000 can be referred to in some &lt;CODE&gt;strptime&lt;/CODE&gt; implementations as &lt;CODE&gt;%z&lt;/CODE&gt; - however, unfortunately Python does not support this identifier. The workaround I can think of is to specify a combination of &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; and &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt; that make sure that ONLY the part of the timestamp before the +0000 is included (i.e. "2012-09-26T02:59:57").&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 05:25:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79592#M16323</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-04T05:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79593#M16324</link>
      <description>&lt;P&gt;Thanks for replying.&lt;BR /&gt;
Yes, I do need TIME_PREFIX and you are right, I do not need to change the default MAX_TIMESTAMP_LOOKAHEAD.&lt;/P&gt;

&lt;P&gt;My current result is that Splunk has successfully extract the timestamp that I want. However, on Splunk search, it does not show the timestamp that I extracted as my event time. &lt;/P&gt;

&lt;P&gt;What I should go about to make that as my event time?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79593#M16324</guid>
      <dc:creator>elaine0102</dc:creator>
      <dc:date>2020-09-28T12:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79594#M16325</link>
      <description>&lt;P&gt;If Splunk extracted your timestamp correctly, what do you mean by that it is not your event time? Do you mean that you have created a separate extraction that extracts this timestamp as a FIELD, but on top of that you want Splunk to use this as the event timestamp as well?&lt;/P&gt;

&lt;P&gt;Which timestamp does Splunk currently use for these events? If you check your splunkd.log, do you see any errors related to the timestamp extraction for this source?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2012 06:01:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79594#M16325</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-04T06:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79595#M16326</link>
      <description>&lt;P&gt;Sorry, just realised that I encountered this warning when I preview my data with the following setting: &lt;/P&gt;

&lt;P&gt;TIME_PREFIX = created_time&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;/P&gt;

&lt;P&gt;Warning: Could not use strptime to parse timestamp from &lt;BR /&gt;
" = 2012-09-26T02:59:57+0000 , updated_time = 2012-10-01T01:40:34+0000 counter:0".&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79595#M16326</guid>
      <dc:creator>elaine0102</dc:creator>
      <dc:date>2020-09-28T12:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79596#M16327</link>
      <description>&lt;P&gt;Pardon me for my confusing issue. Created_time is the one I want it to be my event_time.&lt;/P&gt;

&lt;P&gt;Previously, I have overlooked the warning of timestamp and had the created_time became one of the interesting field.&lt;/P&gt;

&lt;P&gt;Thus, I guessed that is why my event_time is the time when I added the data into Splunk and not the created_time as my event_time.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79596#M16327</guid>
      <dc:creator>elaine0102</dc:creator>
      <dc:date>2020-09-28T12:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79597#M16328</link>
      <description>&lt;P&gt;I checked your time format against the sample date you provided, and it works just like it should. What's your current config? Did you remove the TIME_PREFIX and MAX_TIMESTAMP_LOOKAHEAD?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:34:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79597#M16328</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2020-09-28T12:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79598#M16329</link>
      <description>&lt;P&gt;current config:&lt;BR /&gt;
TIME_PREFIX = created_time&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;/P&gt;

&lt;P&gt;I did not remove TIME_PREFIX as I do need it.&lt;BR /&gt;
As the timestamp is located very far into the event text.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79598#M16329</guid>
      <dc:creator>elaine0102</dc:creator>
      <dc:date>2020-09-28T12:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79599#M16330</link>
      <description>&lt;P&gt;OK. I did some more tests - see my updated answer.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2012 09:43:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79599#M16330</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-05T09:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79600#M16331</link>
      <description>&lt;P&gt;I tried the following config, however it does not work too:&lt;/P&gt;

&lt;P&gt;TIME_PREFIX = created_time&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%dT%H:%M:%S&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 23&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:34:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79600#M16331</guid>
      <dc:creator>elaine0102</dc:creator>
      <dc:date>2020-09-28T12:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79601#M16332</link>
      <description>&lt;P&gt;I believe you would include the + character with that &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt; (unless you have a space after "created_time"). Check splunkd.log to see what it says about its strptime parsing attempts.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2012 04:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79601#M16332</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-10-08T04:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp recognition</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79602#M16333</link>
      <description>&lt;P&gt;Assuming the number after the + is 10,000ths of a second you can tell splunk to use this with :-&lt;/P&gt;

&lt;P&gt;TIME_FORMAT = %Y-%m-%dT%H:%M:%S+%4N&lt;/P&gt;

&lt;P&gt;If it is consistently +0000 you can specify it in the time format.&lt;/P&gt;

&lt;P&gt;TIME_FORMAT = %Y-%m-%dT%H:%M:%S+0000&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2013 16:25:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Timestamp-recognition/m-p/79602#M16333</guid>
      <dc:creator>BobM</dc:creator>
      <dc:date>2013-05-22T16:25:39Z</dc:date>
    </item>
  </channel>
</rss>

