<?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: manipulate timestamp in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418196#M170788</link>
    <description>&lt;P&gt;I am not 100% sure about this, but you can try to use an additional &lt;CODE&gt;datetime.xml&lt;/CODE&gt; to extract the year from the filename. I am not aware of any method to exract the time (which is an index-time operation, hence done per-event) from any event earlier in the file.&lt;/P&gt;

&lt;P&gt;Check &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configuredatetimexml"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configuredatetimexml&lt;/A&gt; for details of the datetime.xml usage.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jun 2019 10:38:27 GMT</pubDate>
    <dc:creator>DMohn</dc:creator>
    <dc:date>2019-06-11T10:38:27Z</dc:date>
    <item>
      <title>manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418193#M170785</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
in my organisation we have few kinds of log format&lt;BR /&gt;
one of them does not have the year in the time stamp so the event looks like:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Jun  6 02:32:43 : Info:Environment.cpp:27: MARINERVAR&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;this is causes me lots of problems in the report since splunk does not now what to do with this timestamp and i have cases where i get future time &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;at the begging of the file i have full date&lt;BR /&gt;
it looks like :&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Thu Jun  6 02:32:43 CDT 2019&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;is it possible to use the year from the begging of the file and add it to timestamp at index time ?&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 08:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418193#M170785</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-06-11T08:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418194#M170786</link>
      <description>&lt;P&gt;A missing year to your timestamp should not cause any problems if you have set up timestamp recognition in your props.conf correctly.&lt;/P&gt;

&lt;P&gt;Try using the following parameters in props.conf for your relevant sourcetype (assuming the timestamp is at the beginning of your event):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
TIME_PREFIX = ^
TIME_FORMAT = %b %d %H:%M:%S
MAX_TIMESTAMP_LOOKAHEAD = 16
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should tell Splunk how to read your timestamp correctly and not produce any future-timestamped events, as it will try to stay as close to the current time as possible.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 09:41:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418194#M170786</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-06-11T09:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418195#M170787</link>
      <description>&lt;P&gt;this is the configuration i have :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[fdm_f123_systemLog]
BREAK_ONLY_BEFORE = ^\w\s\d+\s\d{2}:\d{2}:\d{2}
DATETIME_CONFIG =
LINE_BREAKER = ([\r\n]+)
MAX_TIMESTAMP_LOOKAHEAD = 15
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
TIME_FORMAT = %b %e %H:%M:%S
TIME_PREFIX = ^
TRUNCATE = 0
category = Custom
disabled = false
pulldown_type = 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is it ok ?&lt;/P&gt;

&lt;P&gt;the problem is not only the future date &lt;BR /&gt;
the problem is that it is possible that i will have events from 2018 at the same file&lt;BR /&gt;
is it possible to take the year from somewhere else ?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 10:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418195#M170787</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-06-11T10:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418196#M170788</link>
      <description>&lt;P&gt;I am not 100% sure about this, but you can try to use an additional &lt;CODE&gt;datetime.xml&lt;/CODE&gt; to extract the year from the filename. I am not aware of any method to exract the time (which is an index-time operation, hence done per-event) from any event earlier in the file.&lt;/P&gt;

&lt;P&gt;Check &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configuredatetimexml"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.0/Data/Configuredatetimexml&lt;/A&gt; for details of the datetime.xml usage.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 10:38:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418196#M170788</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-06-11T10:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418197#M170789</link>
      <description>&lt;P&gt;taking it from file name will not help in that case since i can have events from year before&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 10:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418197#M170789</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-06-11T10:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418198#M170790</link>
      <description>&lt;P&gt;In that case the only possibility would be - as bad as it sounds - to check your logging ...&lt;/P&gt;

&lt;P&gt;If you get logs in one file that are years apart, I would personally consider the logging itself to be crap. &lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 12:34:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418198#M170790</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-06-11T12:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: manipulate timestamp</title>
      <link>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418199#M170791</link>
      <description>&lt;P&gt;yeah i know.. it is not on my side&lt;BR /&gt;
thanks&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 12:09:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/manipulate-timestamp/m-p/418199#M170791</guid>
      <dc:creator>sarit_s</dc:creator>
      <dc:date>2019-06-12T12:09:26Z</dc:date>
    </item>
  </channel>
</rss>

