<?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: Could not use strptime to parse timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50896#M12235</link>
    <description>&lt;P&gt;I suggest that you leave &lt;STRONG&gt;out&lt;/STRONG&gt; the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; and just have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NO_BINARY_CHECK=1
SHOULD_LINEMERGE=false
TIME_PREFIX=america-
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk is very good at figuring out the time format automatically, and can easily adjust to the fact that there are variations. You also don't need the &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt;, and you probably shouldn't use it if you can't predict the number of characters after &lt;CODE&gt;america-&lt;/CODE&gt; to the timestamp.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2013 03:57:51 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2013-03-05T03:57:51Z</dc:date>
    <item>
      <title>Could not use strptime to parse timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50895#M12234</link>
      <description>&lt;P&gt;I have researched this error previously (and found a lot of helpful material).&lt;BR /&gt;
I am stuck with a slightly complicated variation of this commonly known problem. &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Configuretimestamprecognition"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Configuretimestamprecognition&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I need to extract the second timestamp from a certain log file.&lt;BR /&gt;
The log file has different kinds of sub-log-types merged into one giant log file. &lt;/P&gt;

&lt;P&gt;Which means, I need to extract the second timestamp (&lt;STRONG&gt;that presents itself at a varying number of characters distance from the FIRST useless time stamps&lt;/STRONG&gt;) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Mar  4 10:05:02 america-p01 access_combined: 10.142.1.109 - - [04/Mar/2013:02:05:03 -0800] "GET /healthCheck/status " 200 13 "-" "-"

Mar  4 10:05:10 america-p01 syslog: 2013-03-04 02:05:11,771 INFO  [http-0.0.0.0-8080-3] -TpaiL5RBCo4-CH-Fjo9rw__ ERI IdsPatientLogger - Logging the CREATE of Account: 464c-9f5c-074ab072ee58 by User: ERI

Mar  4 10:06:27 america-p01 auditlog: AuditEntry[event=LoginRequest,ip=,date=2013-03-04T02:06:28.057-08:00,user=olivia,status=Success,description=]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt; &lt;BR /&gt;
My props.conf looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  NO_BINARY_CHECK=1
    SHOULD_LINEMERGE=false
    TIME_FORMAT=%d/%b/%Y:%H:%M:%S %Z
    TIME_PREFIX=america-
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I expect is for Splunk to recognize the following as correct timestamps and use these SECOND timestamps instead&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;i) For access_combined -&amp;gt; [04/Mar/2013:02:05:03 -0800]
ii) For syslog -&amp;gt; 2013-03-04 02:05:11,771
iii) For auditlog -&amp;gt; 2013-03-04T02:06:28.057-08:00
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My configuration errors out with the following error for all three types of sub-logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;-&amp;gt; Could not use strp to parse time stamp ....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;
Is it because my configuration is not correct ?&lt;BR /&gt;
Is there no such thing as one regex for all three types of timestamps  ( what I tried to setup in TIME_FORMAT) ?&lt;BR /&gt;
I dont see the point of adding a MAX _ TIMESTAMP _ LOOKAHEAD here  - would that be helpful ? &lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 02:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50895#M12234</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-03-05T02:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Could not use strptime to parse timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50896#M12235</link>
      <description>&lt;P&gt;I suggest that you leave &lt;STRONG&gt;out&lt;/STRONG&gt; the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; and just have&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;NO_BINARY_CHECK=1
SHOULD_LINEMERGE=false
TIME_PREFIX=america-
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk is very good at figuring out the time format automatically, and can easily adjust to the fact that there are variations. You also don't need the &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt;, and you probably shouldn't use it if you can't predict the number of characters after &lt;CODE&gt;america-&lt;/CODE&gt; to the timestamp.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 03:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50896#M12235</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-05T03:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Could not use strptime to parse timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50897#M12236</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I tried that and it did not work unfortunately. &lt;/P&gt;

&lt;P&gt;Splunk keeps thinking that the first timestamp is the correct timestamp. &lt;/P&gt;

&lt;P&gt;Do you think a TIME_FORMAT regex like %d/%b/%Y:%H:%M:%S %Z would be helpful here ?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 04:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50897#M12236</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2013-03-05T04:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Could not use strptime to parse timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50898#M12237</link>
      <description>&lt;P&gt;No, I don't think that the &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt; will help you.&lt;/P&gt;

&lt;P&gt;Try &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;TIME_PREFIX=america-.*?:&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I think that may work better.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2013 14:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-not-use-strptime-to-parse-timestamp/m-p/50898#M12237</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-03-05T14:27:02Z</dc:date>
    </item>
  </channel>
</rss>

