<?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: How to define a time format using regex? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24980#M4041</link>
    <description>&lt;P&gt;You might want to take a look at the following documentation links:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1.6/Admin/ConfigureTimestampRecognition" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.6/Admin/ConfigureTimestampRecognition&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1.6/admin/ConfigurePositionalTimestampExtraction" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.6/admin/ConfigurePositionalTimestampExtraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the event you are showing above, you might want to add something similar such as the following stanza:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;source|sourcetype|host&amp;gt;]
MAX_TIMESTAMP_LOOKAHEAD = 90
TIME_PREFIX = .+(?=\w{3} \d{2}, \d{4} \d{2}:\d{2}:\d{2})
TIME_FORMAT = %b %d, %Y %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The MAX_TIMESTAMP_LOOKAHEAD is the number of characters that Splunk should "skip" before it starts looking for a timestamp. 90 is the number I used above as your time stamp starts after 92 characters. This is something that could be different for different events so you may want to change that value accordingly. The regex for the TIME_PREFIX will essentially match anything before that time stamp format that is at the end of the string which should pretty much guarantee that the correct timestamp is found according to the event you provided.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2011 20:47:43 GMT</pubDate>
    <dc:creator>Rob</dc:creator>
    <dc:date>2011-01-12T20:47:43Z</dc:date>
    <item>
      <title>How to define a time format using regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24978#M4039</link>
      <description>&lt;P&gt;How can I define manually force define the date and time.  Splunk didn't properly processes the correct time in the event vs time it indexed.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;processingFailureEvent  -  HADAP_CPU_ALM  -  M-DAP5_B, Cab 1, Cage 1, Slot 1, HADAP_CPU_ALM 1  -  Jan 12, 2011  10:33:30.&lt;/P&gt;

&lt;P&gt;I have tried to give it a shot like below, but didn't work.&lt;/P&gt;

&lt;P&gt;TIME_FORMAT="%b %d, %Y  %H:%M:%S."&lt;/P&gt;

&lt;P&gt;I appreciate guru's suggestions!  Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2011 09:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24978#M4039</guid>
      <dc:creator>clyde772</dc:creator>
      <dc:date>2011-01-12T09:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a time format using regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24979#M4040</link>
      <description>&lt;P&gt;did you try with TIME_PREFIX to point to the space exactly before your event's timestamp? &lt;/P&gt;

&lt;P&gt;something like this in your props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;source or sourcetype or host&amp;gt;]
TIME_PREFIX = .*\s-\s
TIME_FORMAT = %b %d, %Y %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jan 2011 15:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24979#M4040</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2011-01-12T15:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a time format using regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24980#M4041</link>
      <description>&lt;P&gt;You might want to take a look at the following documentation links:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1.6/Admin/ConfigureTimestampRecognition" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.6/Admin/ConfigureTimestampRecognition&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/4.1.6/admin/ConfigurePositionalTimestampExtraction" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/4.1.6/admin/ConfigurePositionalTimestampExtraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For the event you are showing above, you might want to add something similar such as the following stanza:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;source|sourcetype|host&amp;gt;]
MAX_TIMESTAMP_LOOKAHEAD = 90
TIME_PREFIX = .+(?=\w{3} \d{2}, \d{4} \d{2}:\d{2}:\d{2})
TIME_FORMAT = %b %d, %Y %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The MAX_TIMESTAMP_LOOKAHEAD is the number of characters that Splunk should "skip" before it starts looking for a timestamp. 90 is the number I used above as your time stamp starts after 92 characters. This is something that could be different for different events so you may want to change that value accordingly. The regex for the TIME_PREFIX will essentially match anything before that time stamp format that is at the end of the string which should pretty much guarantee that the correct timestamp is found according to the event you provided.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2011 20:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24980#M4041</guid>
      <dc:creator>Rob</dc:creator>
      <dc:date>2011-01-12T20:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to define a time format using regex?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24981#M4042</link>
      <description>&lt;P&gt;Have you tried simply removing those double-quotes? That could be your problem.  You also don't need a &lt;CODE&gt;.&lt;/CODE&gt; (period) after &lt;CODE&gt;%S&lt;/CODE&gt;  (Oh, and this is not  "regex" syntax, it a &lt;CODE&gt;strptime&lt;/CODE&gt; format string.)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2011 06:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-define-a-time-format-using-regex/m-p/24981#M4042</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2011-01-13T06:41:10Z</dc:date>
    </item>
  </channel>
</rss>

