<?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: failed to parse timestamp for apache error log in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31350#M5505</link>
    <description>&lt;P&gt;This is perhaps a bit old, but documentation indicates a few things that may be relevant (and a few that may not);&lt;/P&gt;

&lt;P&gt;1) make sure that your &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; and &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt; are correct.&lt;/P&gt;

&lt;P&gt;2) From the docs on timestamp assignment - if preceding steps to determine the event time fails: &lt;CODE&gt;5. For file sources, if no date can be identified in the file name, Splunk uses the file's modification time.&lt;/CODE&gt; See &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps&lt;/A&gt; for more info. Your stated event timestamps seem to indicate that this is what happens.&lt;/P&gt;

&lt;P&gt;3) &lt;CODE&gt;CHARSET&lt;/CODE&gt; configuration should be in props.conf on the forwarder, NOT on the indexer, as per &lt;A href="http://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings"&gt;http://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings&lt;/A&gt; . Failure to use the correct &lt;CODE&gt;CHARSET&lt;/CODE&gt; may possibly cause your regexes to fail. &lt;/P&gt;

&lt;P&gt;4) &lt;CODE&gt;MAX_DAYS_HENCE&lt;/CODE&gt; &lt;EM&gt;should not&lt;/EM&gt; play any part here. &lt;/P&gt;

&lt;P&gt;5) on a side note - and this may not be relevant in your case, you might set the &lt;CODE&gt;alwaysOpenFile&lt;/CODE&gt; parameter in inputs.conf to &lt;CODE&gt;1&lt;/CODE&gt; on the forwarder. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/inputsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/inputsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2013 19:10:46 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-08-05T19:10:46Z</dc:date>
    <item>
      <title>failed to parse timestamp for apache error log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31347#M5502</link>
      <description>&lt;P&gt;I am monitoring the error.log of a apache server. A single error log file contains events from 2010 to 2011.  Splunk is able to parse the timestamp for events from 2010 but failed to parse correctly for events from 2011.  All of the events from 2011 got timestamped for 2010/12/31 21:50:47.  I searched the _internal index looking for things related to error.log and found the following error messages:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;01-25-2011 10:32:29.596 WARN  DateParserVerbose - Failed to parse timestamp for event.  Context="source::D:\XXXXXXXX\Apache\logs\error.log|host::XXXXXXXX01|apache_error|remoteport::2123" Text="[Tue Jan 04 08:56:53 2011] [warn] [client XX.XX.XX.XX] [4428] auth_ldap authenticate: user XXXXXX ..."

01-25-2011 10:32:29.596 WARN  DateParserVerbose - The TIME_FORMAT specified is matching timestamps (Tue Jan  4 08:56:53 2011) outside of the acceptable time window. If this timestamp is correct, consider adjusting MAX_DAYS_AGO and MAX_DAYS_HENCE.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After adding MAX_DAYS_HENCE = 30 to props.conf Splunk was able to parse the timestamp correctly.&lt;/P&gt;

&lt;P&gt;The apache error log is been forwarded from a remote Splunk light forwarder. Below lists the configuration:&lt;/P&gt;

&lt;P&gt;inputs.conf on the light forwarder&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor://D:\XXXXXXX\Apache\logs\error.log]
disabled = 0
followTail = 0
sourcetype = apache_error
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf on the indexer&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[apache_error]
CHARSET = BIG5
TIME_PREFIX = \[
TIME_FORMAT = %a %b %d %T %Y
MAX_TIMESTAMP_LOOKAHEAD = 26
MAX_DAYS_HENCE = 30
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The system times of the light forwarder and the indexer are within 1 minute of each other and is current. My question is the MAX_DAYS_HENCE is required to parse the timestamp?&lt;/P&gt;

&lt;P&gt;(some information provided here has been modified and replaced with XX)
Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 11:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31347#M5502</guid>
      <dc:creator>alextsui</dc:creator>
      <dc:date>2011-01-25T11:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: failed to parse timestamp for apache error log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31348#M5503</link>
      <description>&lt;P&gt;Very odd.  I don't see anything about that configuration that would confuse the timestamping code.&lt;/P&gt;

&lt;P&gt;In the original source file, is there a fairly regular stream of events, or are there large (multi-day gaps) perhaps?  Trying to think of anything that might be relevant.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2011 17:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31348#M5503</guid>
      <dc:creator>mitch_1</dc:creator>
      <dc:date>2011-01-25T17:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: failed to parse timestamp for apache error log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31349#M5504</link>
      <description>&lt;P&gt;I checked the error.log, and it does not receive regular stream of evetns.  From what I can see, the files gets written irregularly at least once a day on different hours. I also notice one strange thing.  The last modified time for the file got stuck on Dec 31, 2010 at 9:10am even when it's been written continuously up to now.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2011 14:35:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31349#M5504</guid>
      <dc:creator>alextsui</dc:creator>
      <dc:date>2011-01-31T14:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: failed to parse timestamp for apache error log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31350#M5505</link>
      <description>&lt;P&gt;This is perhaps a bit old, but documentation indicates a few things that may be relevant (and a few that may not);&lt;/P&gt;

&lt;P&gt;1) make sure that your &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; and &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD&lt;/CODE&gt; are correct.&lt;/P&gt;

&lt;P&gt;2) From the docs on timestamp assignment - if preceding steps to determine the event time fails: &lt;CODE&gt;5. For file sources, if no date can be identified in the file name, Splunk uses the file's modification time.&lt;/CODE&gt; See &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/HowSplunkextractstimestamps&lt;/A&gt; for more info. Your stated event timestamps seem to indicate that this is what happens.&lt;/P&gt;

&lt;P&gt;3) &lt;CODE&gt;CHARSET&lt;/CODE&gt; configuration should be in props.conf on the forwarder, NOT on the indexer, as per &lt;A href="http://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings"&gt;http://wiki.splunk.com/Where_do_I_configure_my_Splunk_settings&lt;/A&gt; . Failure to use the correct &lt;CODE&gt;CHARSET&lt;/CODE&gt; may possibly cause your regexes to fail. &lt;/P&gt;

&lt;P&gt;4) &lt;CODE&gt;MAX_DAYS_HENCE&lt;/CODE&gt; &lt;EM&gt;should not&lt;/EM&gt; play any part here. &lt;/P&gt;

&lt;P&gt;5) on a side note - and this may not be relevant in your case, you might set the &lt;CODE&gt;alwaysOpenFile&lt;/CODE&gt; parameter in inputs.conf to &lt;CODE&gt;1&lt;/CODE&gt; on the forwarder. &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/inputsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/inputsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2013 19:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/failed-to-parse-timestamp-for-apache-error-log/m-p/31350#M5505</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-08-05T19:10:46Z</dc:date>
    </item>
  </channel>
</rss>

