<?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: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48008#M9082</link>
    <description>&lt;P&gt;Actually I belive your stanza is wrong.  According to the props.conf.spec, stanzas for sourcetypes only include the actual sourcetype value.  Note the section on the precidence order and setting priorities.  Precidence order between source &amp;gt; host &amp;gt; sourcetype is observed first.  Priorities are observed second.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones"&gt;http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So...&lt;BR /&gt;
[log4j]&lt;BR /&gt;
TZ = Australia/Adelaide&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2011 15:00:40 GMT</pubDate>
    <dc:creator>msorenson</dc:creator>
    <dc:date>2011-10-13T15:00:40Z</dc:date>
    <item>
      <title>Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48005#M9079</link>
      <description>&lt;P&gt;My input from log4j looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2011-07-28 15:45:25,402  INFO  ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And splunk is indexing it as &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;28/07/2011 16:15:25.402
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i.e 30 minutes out, which is normal when systems don't handle half hour timezones like Australia/Adelaide.&lt;/P&gt;

&lt;P&gt;I've tried configuring Splunk-4.2.2\etc\system\local\props.conf with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype::log4j]
TZ = Australia/Adelaide
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But its not doing what I expect.&lt;/P&gt;

&lt;P&gt;CST stands for central standard time (which Australia supports too) and not the US CST.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Edit 1&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;It got worse in the afternoon&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;27/07/2011 05:53:05.360  2011-07-26 14:53:05,360
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can see that the minutes, seconds and milliseconds are correct.&lt;BR /&gt;
The hour is now 13 hours out which pushes it into the next day.&lt;BR /&gt;
And that is odd since 2011-07-26 14:53:05,360 + 9.5 = 2011-07-26 23:53:05,360 and not 27/07/2011 05:53:05.360&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Edit 2&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I removed the TZ in the props.conf and the timestamps are back to being 30 minutes out.&lt;BR /&gt;
Looks like attempting to fix the problem by specifying the the TZ didn't work and made things worse.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Edit 3&lt;/EM&gt;&lt;BR /&gt;
&lt;IMG src="http://www.freeimagehosting.net/e0238" alt="Splunk Search Screenshot" /&gt;&lt;/P&gt;

&lt;P&gt;Stupid image upload doesn't work try here: &lt;A href="http://www.freeimagehosting.net/e0238"&gt;http://www.freeimagehosting.net/e0238&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 02:27:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48005#M9079</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-07-25T02:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48006#M9080</link>
      <description>&lt;P&gt;It's probably because I was doing something wrong, but I've only had success in forcing the timezone by setting it per host.  &lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2011 17:15:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48006#M9080</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2011-10-12T17:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48007#M9081</link>
      <description>&lt;P&gt;Can you provide explicit details on how you did this via host please?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2011 00:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48007#M9081</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-10-13T00:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48008#M9082</link>
      <description>&lt;P&gt;Actually I belive your stanza is wrong.  According to the props.conf.spec, stanzas for sourcetypes only include the actual sourcetype value.  Note the section on the precidence order and setting priorities.  Precidence order between source &amp;gt; host &amp;gt; sourcetype is observed first.  Priorities are observed second.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones"&gt;http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;So...&lt;BR /&gt;
[log4j]&lt;BR /&gt;
TZ = Australia/Adelaide&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2011 15:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48008#M9082</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2011-10-13T15:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48009#M9083</link>
      <description>&lt;P&gt;Hmm, After following up on this post, I notice that my props file now has [log4j] as the stanza, because I was implementing&lt;/P&gt;

&lt;PRE&gt;
# Force log4j to only make events that start with log4j pattern, not based on newlines
# See &lt;A href="http://splunk-base.splunk.com/answers/3682/need-to-customize-log4j-sourcetype" target="test_blank"&gt;http://splunk-base.splunk.com/answers/3682/need-to-customize-log4j-sourcetype&lt;/A&gt;
&lt;/PRE&gt;

&lt;P&gt;And I had commented out the TZ value.&lt;BR /&gt;
Which probably means I've tried it before.&lt;BR /&gt;
But who knows, will give it another try.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2011 23:27:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48009#M9083</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-10-13T23:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48010#M9084</link>
      <description>&lt;P&gt;I've found it pretty difficult to use [&lt;SOURCETYPE&gt;] to do anything.  My guess is that its precidence is so low that something is bound to go first.&lt;/SOURCETYPE&gt;&lt;/P&gt;

&lt;P&gt;Try defining the TZ within a statement relative to source or host.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...&amp;lt;psuedo PCRE&amp;gt;...]
TZ = Australia/Adelaide

[host::&amp;lt;someHost&amp;gt;]
TZ = Australia/Adelaide
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Oct 2011 23:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48010#M9084</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2011-10-13T23:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48011#M9085</link>
      <description>&lt;P&gt;This didn't work&lt;/P&gt;

&lt;PRE&gt;
14/10/2011 11:22:27.959 (what splunk lists as the time in the search)
2011-10-14 10:52:27,959 (what log4j logs)
&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Oct 2011 00:24:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48011#M9085</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-10-14T00:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48012#M9086</link>
      <description>&lt;P&gt;Think the "," delimiting the fraction of a second is causing the problem?  Not sure why Splunk would trip on that.  You could try what gkanapathy suggested for a more extreme case (&lt;A href="http://splunk-base.splunk.com/answers/6413/timestamp-problem-propsconf"&gt;http://splunk-base.splunk.com/answers/6413/timestamp-problem-propsconf&lt;/A&gt;), but changed to the following.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;
   &amp;lt;define name="_mydatetimeformat" extract="year, month, day, hour, minute, second"&amp;gt;
       &amp;lt;text&amp;gt;&amp;lt;![CDATA[^.*(20[\d]{2})\-(0[1-9]|1[0-2])\-([0-3][0-9])\s+([01][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9])]]&amp;gt;&amp;lt;/text&amp;gt;
   &amp;lt;/define&amp;gt;
   &amp;lt;timePatterns&amp;gt;
       &amp;lt;use name="_mydatetimeformat"/&amp;gt;
   &amp;lt;/timePatterns&amp;gt;
   &amp;lt;datePatterns&amp;gt;
       &amp;lt;use name="_mydatetimeformat"/&amp;gt;
   &amp;lt;/datePatterns&amp;gt; 
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where your props.conf will look something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4j]
DATETIME_CONFIG = /etc/apps/myapp/local/mycustomdatetime.xml
TZ = Australia/Adelaide
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or...&lt;/P&gt;

&lt;P&gt;You can try specifying the a valid time format using TIME_FORMAT.  I don't know if my example will work or not.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[log4j]
TIME_PREFIX = &amp;lt;regex to match up to date | ommit if date/time is a front of event&amp;gt;
TIME_FORMAT = %Y-%m-%d %T
TZ = Australia/Adelaide
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;A Google search for strptime resolved this site among others (&lt;A href="http://pubs.opengroup.org/onlinepubs/007904975/functions/strptime.html"&gt;http://pubs.opengroup.org/onlinepubs/007904975/functions/strptime.html&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;...or...&lt;/P&gt;

&lt;P&gt;Change the log4j's configuraton to not use the comma to delimit the sub-second.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 02:12:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48012#M9086</guid>
      <dc:creator>msorenson</dc:creator>
      <dc:date>2011-10-14T02:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48013#M9087</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf&lt;/A&gt; says&lt;/P&gt;

&lt;PRE&gt;
For settings that are specified in multiple categories of matching [&lt;SPEC&gt;] stanzas,
[host::&lt;HOST&gt;] settings override [&lt;SOURCETYPE&gt;] settings. Additionally,
[source::&lt;SOURCE&gt;] settings override both [host::&lt;HOST&gt;] and
[&lt;SOURCETYPE&gt;] settings.
&lt;/SOURCETYPE&gt;&lt;/HOST&gt;&lt;/SOURCE&gt;&lt;/SOURCETYPE&gt;&lt;/HOST&gt;&lt;/SPEC&gt;&lt;/PRE&gt;

&lt;P&gt;Attempting &lt;/P&gt;

&lt;PRE&gt;
[source::*]
# Attempt to fix messageDate in wrong timezone
TZ = Australia/Adelaide
&lt;/PRE&gt;

&lt;P&gt;...&lt;/P&gt;

&lt;P&gt;Nope still out by half hour.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 03:38:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48013#M9087</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-10-14T03:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48014#M9088</link>
      <description>&lt;P&gt;I think I need that precision.&lt;/P&gt;

&lt;P&gt;From &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/TrainSplunktorecognizeatimestamp"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/TrainSplunktorecognizeatimestamp&lt;/A&gt; running&lt;/P&gt;

&lt;PRE&gt;
splunk train dates
&lt;/PRE&gt;

&lt;P&gt;And providing these log files snippets returns:&lt;/P&gt;

&lt;PRE&gt;
From:   2011-10-14 10:52:26,853 INFO  {}
Parsed: Fri Oct 14 10:52:26 2011
UTC Time:       1318551746
Time Region:    11-24
Date Region:    0-10
Subseconds:     0.853
&lt;/PRE&gt;

&lt;P&gt;So splunk can get the correct values, I dont know what it's doing when it displays it in the timestamp pick list to be half an hours out.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 03:56:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48014#M9088</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-10-14T03:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk index Timestamp half an hour out compared with log4j timestamp (Australia/Adelaide timezone is +9.5)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48015#M9089</link>
      <description>&lt;P&gt;I'm going to assume for know that this is a display bug and there is nothing I can do.&lt;/P&gt;

&lt;P&gt;As you can see from the comment threads below, Splunk is able to parse my dates just fine.  It's only in the timestamp in the field pick list on screen that is wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2011 04:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-index-Timestamp-half-an-hour-out-compared-with-log4j/m-p/48015#M9089</guid>
      <dc:creator>baerrach</dc:creator>
      <dc:date>2011-10-14T04:01:12Z</dc:date>
    </item>
  </channel>
</rss>

