<?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: Timestamp Problem props.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43695#M10283</link>
    <description>&lt;P&gt;Hey gkanapathy, I tested your custom file and it works! I get the timestamp I require. Thanks a lot for your help. Very much appreciated. I 'owe' you a drink &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Sep 2010 20:27:43 GMT</pubDate>
    <dc:creator>Ant1D</dc:creator>
    <dc:date>2010-09-06T20:27:43Z</dc:date>
    <item>
      <title>Timestamp Problem props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43691#M10279</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I'm having difficulty getting my Splunk instance to extract the part of the timestamp that I want Splunk to set as my timestamp under _time field.&lt;/P&gt;

&lt;P&gt;For example, I have the following timestamp entry in a log file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;8976 31/08/2010 22:55:00 Load Tue 22:55:00 Wed 00:00:57
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want splunk to use 31/08/2010 with 00:00:57 as my timestamp and ignore the rest of it. How can I configure props.conf to enable this?&lt;/P&gt;

&lt;P&gt;I believe the right regex syntax for TIME_PREFIX may help.&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;LATEST as of Friday 6pm&lt;/P&gt;

&lt;P&gt;I have written the following regex which should capture the specific date and time that I want in my timestamp as specified above:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(\d{2}\/\d{2}\/\d{4}) \d{2}\:\d{2}\:\d{2} \w{4} \w{3} \d{2}\:\d{2}\:\d{2} \w{3} (\d{2}\:\d{2}\:\d{2})
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, where would I put this regex to get Splunk to make it work?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2010 22:30:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43691#M10279</guid>
      <dc:creator>Ant1D</dc:creator>
      <dc:date>2010-09-03T22:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Problem props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43692#M10280</link>
      <description>&lt;P&gt;You should review this web page:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Configurepositionaltimestampextraction" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/Admin/Configurepositionaltimestampextraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The setting you probably want to use is the TIME_FORMAT:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TIME_FORMAT = &amp;lt;strptime-style format&amp;gt;
* Specifies a strptime format string to extract the date. 
* For more information on strptime see `man strptime` or "Configure timestamp recognition" in the Splunk Admin Manual.
* This method of date extraction does not support in-event timezones. 
* TIME_FORMAT starts reading after the TIME_PREFIX. 
* For good results, the &amp;lt;strptime-style format&amp;gt; should describe the day of the year and the time of day.
* Defaults to empty.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For examples, you can reference the $SPLUNK_HOME/etc/system/default/props.conf settings for various sourcetypes.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2010 22:42:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43692#M10280</guid>
      <dc:creator>Simeon</dc:creator>
      <dc:date>2010-09-03T22:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Problem props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43693#M10281</link>
      <description>&lt;P&gt;This will be hard if date and time are that widely separated, with things that look the same in between. You probably can't do it with TIME_PREFIX and TIME_FORMAT. Instead, you're probably best off using a custom datetime.xml config file. So, in props.conf, your sourcetype should specify:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;DATETIME_CONFIG = /etc/apps/myapp/local/mycustomdatetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then create the file (in $SPLUNK_HOME/etc/apps/myapp/local/mycustomdatetime.xml):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;datetime&amp;gt;
   &amp;lt;define name="_mydatetimeformat" extract="day, month, year, hour, minute, second"&amp;gt;
       &amp;lt;text&amp;gt;&amp;lt;![CDATA[^\S+\s+(\d+)/(\d+)/(\d+)\s+(?:\S+\s+){5}(\d+):(\d+):(\d+)]]&amp;gt;&amp;lt;/text&amp;gt;
   &amp;lt;/define&amp;gt;
   &amp;lt;timePatterns&amp;gt;
       &amp;lt;use name="_mydatetimeformat"/&amp;gt;
   &amp;lt;/timePatterns&amp;gt;
   &amp;lt;datePatterns&amp;gt;
       &amp;lt;use name="_mydatetimeformat"/&amp;gt;
   &amp;lt;/datePatterns&amp;gt; 
&amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I haven't really tested that regex, but basically, each capture group matches up in order with the fields that are listed in the "extract" attribute.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Sep 2010 23:57:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43693#M10281</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-09-03T23:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Problem props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43694#M10282</link>
      <description>&lt;P&gt;I will have a look into this on Monday. Thanks for you help. I don't mean to be cheeky but if you could give it a test, I would appreciate that a lot. Could you have a look at the 'LATEST as of Friday 6pm' section in my edited question above and let me know what you think. Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2010 00:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43694#M10282</guid>
      <dc:creator>Ant1D</dc:creator>
      <dc:date>2010-09-04T00:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Problem props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43695#M10283</link>
      <description>&lt;P&gt;Hey gkanapathy, I tested your custom file and it works! I get the timestamp I require. Thanks a lot for your help. Very much appreciated. I 'owe' you a drink &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2010 20:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43695#M10283</guid>
      <dc:creator>Ant1D</dc:creator>
      <dc:date>2010-09-06T20:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Timestamp Problem props.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43696#M10284</link>
      <description>&lt;P&gt;Thanks for the link Simeon&lt;/P&gt;</description>
      <pubDate>Mon, 06 Sep 2010 20:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timestamp-Problem-props-conf/m-p/43696#M10284</guid>
      <dc:creator>Ant1D</dc:creator>
      <dc:date>2010-09-06T20:28:13Z</dc:date>
    </item>
  </channel>
</rss>

