<?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: Need help with TIME_PREFIX in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328216#M163302</link>
    <description>&lt;P&gt;hey try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %b %d %H:%M:%S.%3N
TIME_PREFIX = \s\d{1,3}:\s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jan 2018 15:35:07 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-01-26T15:35:07Z</dc:date>
    <item>
      <title>Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328215#M163301</link>
      <description>&lt;P&gt;Given a representative sample of my logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jan 25 14:19:20 1.1.1.1 64: Jan 25 22:19:19.281: %LINK-3-UPDOWN: xxxxxxxxxxxxxxxxxxxxxxxxxx
Jan 25 14:19:15 1.1.1.1 74: Jan 25 22:19:15.282: %LINK-3-UPDOWN: xxxxxxxxxxxxxxxxxxxxxxxxxx
Jan 25 14:18:56 1.1.1.1 79: Jan 25 22:18:56.285: %LINK-3-UPDOWN: xxxxxxxxxxxxxxxxxxxxxxxxxx
Jan 25 14:18:25 1.1.1.1 66: Jan 25 22:18:25.284: %LINK-3-UPDOWN: xxxxxxxxxxxxxxxxxxxxxxxxxx
Jan 25 14:18:15 1.1.1.1 62: Jan 25 22:18:15.274: %LINK-3-UPDOWN: xxxxxxxxxxxxxxxxxxxxxxxxxx
Jan 25 14:17:22 1.1.1.1 34: Jan 25 22:17:22.287: %LINK-3-UPDOWN: xxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These logs are being written to a file on my Heavy Forwarder and the HF is monitoring the file and sending to the indexers.  Currently I'm testing a new source on a new HF.  The same configuration is being used on another HF and I've just copied the props.conf from the previous HF to the new one.  But I'm having some weird behavior when trying to extract the time field.&lt;/P&gt;

&lt;P&gt;I want to use the second timestamp as the time.  Here is my props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = \w{3}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s\d+:\s+
MAX_TIMESTAMP_LOOKAHEAD = 15
TIME_FORMAT = %b\s+%d\s+%H:%M:%S.%3N
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk shows the time for all events as   &lt;CODE&gt;_time =  "Jan 25 2018 5:19:19 PM"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Which is the time of the top event and the timestamp of the file it is reading from.  Which makes me thing that Splunk could not parse the timestamp.&lt;/P&gt;

&lt;P&gt;I've tried the following TIME_PREFIX modifications:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_PREFIX = ^(?:[^\n]* ) {5}
TIME_PREFIX = \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s\d+:\s+
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I've tried &lt;CODE&gt;TIME_PREFIX = ^&lt;/CODE&gt;to try to get the first timestamp.&lt;/P&gt;

&lt;P&gt;Same issue.  Did I make a config mistake, syntax?&lt;BR /&gt;&lt;BR /&gt;
I saw other people had found an error that says &lt;CODE&gt;"Could not use strptime to parse timestamp from xxxxx"&lt;/CODE&gt;, but I'm not sure where splunk would write that (splunkd.log?)....&lt;/P&gt;

&lt;P&gt;Thanks for any suggestions&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 15:24:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328215#M163301</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2018-01-26T15:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328216#M163302</link>
      <description>&lt;P&gt;hey try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = %b %d %H:%M:%S.%3N
TIME_PREFIX = \s\d{1,3}:\s
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 15:35:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328216#M163302</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-26T15:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328217#M163303</link>
      <description>&lt;P&gt;Again, this SHOULD work, but doesn't and returns the same result.  Is there anywhere in the splunk logs to see where it fails?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 16:47:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328217#M163303</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2018-01-26T16:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328218#M163304</link>
      <description>&lt;P&gt;have you changed your &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD = 15&lt;/CODE&gt; to &lt;CODE&gt;MAX_TIMESTAMP_LOOKAHEAD = 30&lt;/CODE&gt; ?&lt;BR /&gt;
Also try putting the same on indexer as well!&lt;/P&gt;

&lt;P&gt;look for warning on search head&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal "Failed to parse timestamp"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jan 2018 16:57:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328218#M163304</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-26T16:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328219#M163305</link>
      <description>&lt;P&gt;That didn't work either.&lt;/P&gt;

&lt;P&gt;So I copied some logs in to a new file, then ran through the wizard to import those logs into splunk and let splunk create the props.conf.&lt;/P&gt;

&lt;P&gt;Here's what Splunk created:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DATETIME_CONFIG = 
NO_BINARY_CHECK = true
category = Custom
pulldown_type = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That worked.&lt;BR /&gt;&lt;BR /&gt;
----- whatever.....&lt;/P&gt;

&lt;P&gt;Now the problem is that props.conf is not tied to the syslog autoparsing that splunk does....&lt;/P&gt;

&lt;P&gt;problem for another day... I'll update next week...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 19:53:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328219#M163305</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2018-01-26T19:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328220#M163306</link>
      <description>&lt;P&gt;Fixed.  Not the most elegant, but it works.  Took the sourcetype Splunk created in the above step, found the built in Cisco/syslog config, copied it to the created sourcetype, restarted and it works.&lt;/P&gt;

&lt;P&gt;for now.  &lt;/P&gt;

&lt;P&gt;It's ugly but it works.&lt;/P&gt;

&lt;P&gt;EDIT:  To clarify, that is the sourcetype Splunk created as I describe in my answer above.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328220#M163306</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2018-01-26T20:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with TIME_PREFIX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328221#M163307</link>
      <description>&lt;P&gt;Hey reswob4&lt;/P&gt;

&lt;P&gt;If you found the solution yourself, make sure you accept the answer.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 20:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-TIME-PREFIX/m-p/328221#M163307</guid>
      <dc:creator>Anam</dc:creator>
      <dc:date>2018-01-26T20:20:21Z</dc:date>
    </item>
  </channel>
</rss>

