<?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: Custom timestamp detection for a sourcetype with some event w/o timestamp in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476641#M81825</link>
    <description>&lt;P&gt;would be very interesting, to know the result of your test @D2SI as i had the same understanding you had. &lt;BR /&gt;
couple links for reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Admin/Propsconf#Timestamp_extraction_configuration"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/Admin/Propsconf#Timestamp_extraction_configuration&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 13:22:34 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2020-01-09T13:22:34Z</dc:date>
    <item>
      <title>Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476637#M81821</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;

&lt;P&gt;For a particular sourcetype there are events with a timestamp and events without timestamp.&lt;/P&gt;

&lt;P&gt;As Splunk cannot detect a timestamp in the events without timestamp, it generates plenty of errors saying 'Defaulting to timestamp of previous event'.&lt;/P&gt;

&lt;P&gt;I am trying to clean this up.&lt;/P&gt;

&lt;P&gt;I see that I can configure a local datetime.xml to take into account various timestamp formats.&lt;/P&gt;

&lt;P&gt;What I would like to do is : &lt;/P&gt;

&lt;P&gt;for event with a timestamp -&amp;gt; assign the correct timestamp&lt;/P&gt;

&lt;P&gt;for events without timestamp -&amp;gt; assign the indexing time as the timestamp and don't throw errors&lt;/P&gt;

&lt;P&gt;Is there a way in datetime.xml to say : for this format, apply indextime timestamp?&lt;/P&gt;

&lt;P&gt;Thanks in advance for any hint!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 14:41:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476637#M81821</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2020-01-08T14:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476638#M81822</link>
      <description>&lt;P&gt;probably doesnt answer your question directly, but here is a workaround.&lt;BR /&gt;
index all events with current timestamp&lt;BR /&gt;
in search extract the timestamp for the field that contains time, lets say you will call it &lt;CODE&gt;event_time&lt;/CODE&gt;&lt;BR /&gt;
now in search (if need to use time other then current), run something like this:&lt;BR /&gt;
&lt;CODE&gt;... | eval _time = if(isnull(event_time),_time,event_time) ...&lt;/CODE&gt; or something along those lines&lt;BR /&gt;
hope it helps a little bit&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 21:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476638#M81822</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-01-08T21:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476639#M81823</link>
      <description>&lt;P&gt;I would suggest to use the big 6/8 of props.conf&lt;BR /&gt;
Your props should contain these   &lt;STRONG&gt;"TIME_PREFIX, TIME_FORMAT, MAX_TIMESTAMP_LOOKAHEAD"&lt;/STRONG&gt; and &lt;BR /&gt;
add "&lt;STRONG&gt;DATETIME_CONFIG = current&lt;/STRONG&gt;".&lt;/P&gt;

&lt;P&gt;DATETIME_CONFIG is when Splunk can't find something to match TIME_* .&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:36:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476639#M81823</guid>
      <dc:creator>mloyola_splunk</dc:creator>
      <dc:date>2020-09-30T03:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476640#M81824</link>
      <description>&lt;P&gt;Thanks for your answer.&lt;/P&gt;

&lt;P&gt;Your are saying that with TIME_* parameters configured and DATETIME_CONFIG set to current, events with a timestamp will get timestamped according to TIME_* parameters while events from the same sourcetype without timestamp will have the indextime as the timestamp.&lt;/P&gt;

&lt;P&gt;To my understanding setting DATETIME_CONFIG to current overrides all the TIME_* parameters and set the indextime as timestamp but I will test this.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476640#M81824</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2020-09-30T03:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476641#M81825</link>
      <description>&lt;P&gt;would be very interesting, to know the result of your test @D2SI as i had the same understanding you had. &lt;BR /&gt;
couple links for reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/Admin/Propsconf#Timestamp_extraction_configuration"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/Admin/Propsconf#Timestamp_extraction_configuration&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://wiki.splunk.com/Community:HowIndexingWorks"&gt;https://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 13:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476641#M81825</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-01-09T13:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476642#M81826</link>
      <description>&lt;P&gt;Alright I have tested it and it does not work, I mean if DATETIME_CONFIG is set to CURRENT, it overrides any other TIME_* parameter and set timestamp to indextime.&lt;/P&gt;

&lt;P&gt;Thanks anyhow for the suggestion.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476642#M81826</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2020-09-30T03:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476643#M81827</link>
      <description>&lt;P&gt;Another way to solve this is to use INGEST_EVAL in transforms.conf.  &lt;/P&gt;

&lt;H2&gt;I tried this config and works for me.&lt;/H2&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[test]&lt;BR /&gt;
LINE_BREAKER = ([\r\n]+)(\d+|\w+)&lt;BR /&gt;
SHOULD_LINEMERGE = false&lt;BR /&gt;
TIME_PREFIX = ^&lt;BR /&gt;
TIME_FORMAT = %Y-%m-%d %H:%M:%S.%3N&lt;BR /&gt;
MAX_TIMESTAMP_LOOKAHEAD = 30&lt;BR /&gt;
TRANSFORMS = modtimestamp&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;[modtimestamp]&lt;BR /&gt;
INGEST_EVAL = _time[float]:=if(match(_raw,"^(?!\d+-\d+-\d+).*"),time(),_time)&lt;/P&gt;

&lt;H1&gt;it filters the events that doesnt start with the year and apply the condition&lt;/H1&gt;

&lt;H1&gt;time() is more expensive and acts on every event separately. now() appears to only be valid in search and is the time of the search itself.&lt;/H1&gt;

&lt;P&gt;Note: This configuration might be very impactful on the indexer's performance.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476643#M81827</guid>
      <dc:creator>jarizeloyola</dc:creator>
      <dc:date>2020-09-30T03:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476644#M81828</link>
      <description>&lt;P&gt;imho the workaround i suggested in the comment directly under the question performs better.&lt;BR /&gt;
and only being used if needed (search time)&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 14:10:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476644#M81828</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2020-01-10T14:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476645#M81829</link>
      <description>&lt;P&gt;Depends on his requirements , either at the index  or search time. whatever that  helps him. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 14:26:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476645#M81829</guid>
      <dc:creator>jarizeloyola</dc:creator>
      <dc:date>2020-01-10T14:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Custom timestamp detection for a sourcetype with some event w/o timestamp</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476646#M81830</link>
      <description>&lt;P&gt;Thank both of you for your suggested solutions!&lt;/P&gt;

&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt; Good idea,  thank you, I will test this with eval in the props.conf!&lt;/P&gt;

&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/39022"&gt;@jarizeloyola&lt;/a&gt; Thanks! I am using ingest_eval for another source which timestamp can only be found in the filename, and it works great! However, I see splunkd timestamp errors for that source, so I have to check if inges_eval works in a way there will still have timestamp issues generated even if OK, or if it is something else!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:38:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Custom-timestamp-detection-for-a-sourcetype-with-some-event-w-o/m-p/476646#M81830</guid>
      <dc:creator>D2SI</dc:creator>
      <dc:date>2020-09-30T03:38:37Z</dc:date>
    </item>
  </channel>
</rss>

