<?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: Extracting event date/time from record with multiple date/times in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134463#M27622</link>
    <description>&lt;P&gt;This works for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[event_sourcetype]
TIME_FORMAT=%Y-%m-%d %H:%M:%S
TIME_PREFIX=^(?:[^\^\n]*\^){5}
MAX_TIMESTAMP_LOOKAHEAD=50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Make sure the event has a sourcetype associated and utilise that sourcetype name in the props.conf &lt;/P&gt;</description>
    <pubDate>Tue, 10 Feb 2015 10:19:46 GMT</pubDate>
    <dc:creator>mzorzi</dc:creator>
    <dc:date>2015-02-10T10:19:46Z</dc:date>
    <item>
      <title>Extracting event date/time from record with multiple date/times</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134462#M27621</link>
      <description>&lt;P&gt;I have a data input with the following format for which I am struggling to extract the correct data for the SPLUNK event date and time.&lt;/P&gt;

&lt;P&gt;MAIN|^0212345678-2|^6.75|^GBP|^2014-12-16|^&lt;STRONG&gt;2014-12-12 12:27:22&lt;/STRONG&gt;|^1&lt;/P&gt;

&lt;P&gt;The date time field I want to use for the event time is &lt;STRONG&gt;2014-12-12 12:27:22&lt;/STRONG&gt; however SPLUNK seems to be using a combination of different fields to build the event date and time. For the above record it is deducing an event date and time of 2014-12-16 12:27:22. It seems to be deriving the date from field 5 and the time from field 7. Ultimately I would like the date and time to be derived only from field 7 i.e. 2014-12-12 12:27:22&lt;/P&gt;

&lt;P&gt;I have tried various permutations of the following in my props.conf but still remain unsuccessful.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT=%Y-%m-%d %H:%M:%S
TIME_PREFIX=(?i)^(?:[^\^]*\^){7}
MAX_TIMESTAMP_LOOKAHEAD=50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas on what to try next would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 09:29:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134462#M27621</guid>
      <dc:creator>garryclarke</dc:creator>
      <dc:date>2015-02-10T09:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event date/time from record with multiple date/times</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134463#M27622</link>
      <description>&lt;P&gt;This works for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[event_sourcetype]
TIME_FORMAT=%Y-%m-%d %H:%M:%S
TIME_PREFIX=^(?:[^\^\n]*\^){5}
MAX_TIMESTAMP_LOOKAHEAD=50
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Make sure the event has a sourcetype associated and utilise that sourcetype name in the props.conf &lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 10:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134463#M27622</guid>
      <dc:creator>mzorzi</dc:creator>
      <dc:date>2015-02-10T10:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting event date/time from record with multiple date/times</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134464#M27623</link>
      <description>&lt;P&gt;Thanks mzorzi for pointing me in the right direction. I guess I need to spend a bit more time with my regular expressions.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 11:03:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extracting-event-date-time-from-record-with-multiple-date-times/m-p/134464#M27623</guid>
      <dc:creator>garryclarke</dc:creator>
      <dc:date>2015-02-10T11:03:50Z</dc:date>
    </item>
  </channel>
</rss>

