<?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: Multiple Timestamps in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16074#M1882</link>
    <description>&lt;P&gt;I've added a few more config testing ideas to my answer.  Best of luck.&lt;/P&gt;</description>
    <pubDate>Sat, 26 Jun 2010 02:45:18 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-06-26T02:45:18Z</dc:date>
    <item>
      <title>Multiple Timestamps</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16070#M1878</link>
      <description>&lt;P&gt;My events have two different times in them, one from when the dns server processed them, and then another is added to the beginning of the events from what I assume is splunk.  I want splunk to treat the second time as the events timestamp.  I have manually assigned the sourcetype for the port as dns_data.  Here is part of my props.conf file from $SPLUNK_HOME/etc/sys/local:&lt;/P&gt;

&lt;P&gt;props.conf--&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetype::dns_data]
TIME_PREFIX = \w+ \d+ \d\d:\d\d:\d\d foo\.bar\.com
TIME_FORMAT = %b %d %H:%M:%S %Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here are some events:&lt;/P&gt;

&lt;P&gt;Jun 23 16:29:19 foo.bar.com Wed Jun 23 16:27:15 2010: 123.123.123.123 -&amp;gt; 321.321.321.321: 52826 NOERR 'something.somewhere.com.' A IN (n#5) (x#9)&lt;/P&gt;

&lt;P&gt;Jun 23 16:29:19 foo.bar.com Wed Jun 23 16:27:15 2010: 123.123.231.321 -&amp;gt; 25.321.321.31: 1572 NOERR 'something.somewhere.com.' AAAA IN (x#1)&lt;/P&gt;

&lt;P&gt;Jun 23 16:29:19 foo.bar.com Wed Jun 23 16:27:15 2010: 213.213.21.231 -&amp;gt; 123.123.123.123: 25373 NOERR 'something.somewhere.com.' A IN (a#1) (n#6) (x#11) ANS 'something.somewhere.com. A IN 21.231.231.21&lt;/P&gt;

&lt;P&gt;Any help would be appreciated.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2010 06:47:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16070#M1878</guid>
      <dc:creator>mawwx3</dc:creator>
      <dc:date>2010-06-24T06:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Timestamps</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16071#M1879</link>
      <description>&lt;P&gt;I guess you should use &lt;CODE&gt;[dns_data]&lt;/CODE&gt; as your stanza name instead of &lt;CODE&gt;[sourcetype::dns_data]&lt;/CODE&gt;. The other part of your config looks quite reasonable to me.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2010 02:41:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16071#M1879</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2010-06-25T02:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Timestamps</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16072#M1880</link>
      <description>&lt;P&gt;I you didn't have a &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; I think you would be ok (because you have &lt;CODE&gt;%b&lt;/CODE&gt; in your time format, splunk shouldn't match your first date timestamp because it doesn't have a day of the week shown).  That said, I using &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; is better.&lt;/P&gt;

&lt;P&gt;I see a couple minor but potentially problem-causing issues with your current config:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;I don't think the &lt;CODE&gt;sourcetype::&lt;/CODE&gt; prefix is allowed, as suggested by Siegfried.&lt;/LI&gt;
&lt;LI&gt;Your &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; doesn't allow for a trailing space between the host name and the date that you want to use.&lt;/LI&gt;
&lt;LI&gt;The &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; doesn't allow for a single-digit day (I'm assuming this is a syslog file, in which case the standard format for July 4 would be "Jul__4 2010" (had to use an underscore to get the formatting to show up on this site.)  Your current regex only allows for a single space.&lt;/LI&gt;
&lt;LI&gt;I recommend using a &lt;CODE&gt;^&lt;/CODE&gt; (start of line) in your &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt; to let the regex engine do less work.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Here is what I would suggest you put in your &lt;CODE&gt;props.conf&lt;/CODE&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[dns_data]
TIME_PREFIX = ^\w+ .\d \d\d:\d\d:\d\d \S+\s+
TIME_FORMAT = %b %d %H:%M:%S %Y
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want, you can also use a SEDCMD entry to drop that first date out of there entirely so you consume less bytes in your index.  I have some log sources that do this and it makes it easily to review the logs when there aren't two sets of dates for your eyes to scan over.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SEDCMD-drop_extra_date = s/^\w+ .\d \d\d:\d\d:\d\d (.*)$/\1/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Keep in mind the timestamp extraction happens first, so you don't have to worry about your SEDCMD getting in the way of your &lt;CODE&gt;TIME_PREFIX&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;You could also move the second date (the one your are keeping) to the front if you want to.  (To be more consitent with your other syslog mesages.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SEDCMD-use_2nd_date = s/^\w+ .\d \d\d:\d\d:\d\d (\S+) (\w+ \w+ .\d \d\d:\d\d:\d\d \d{4})(.*)$/\2 \1 \3/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I haven't tested these &lt;CODE&gt;SEDCMD&lt;/CODE&gt; expressions, so they may not work right away.  They are mostly just to give you and idea of what you can do.)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Still not working huh?   Here are a few more things to double check:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Verify that your sourcetype is actually &lt;CODE&gt;dns_data&lt;/CODE&gt; on your indexed events and not &lt;CODE&gt;syslog&lt;/CODE&gt; or something like that.  (You aren't using any sourcetype renaming transformers are you?  If you don't know what I'm talking about then you probably are not.)&lt;/LI&gt;
&lt;LI&gt;Make sure your putting your changes in the correct file.   Should be  &lt;CODE&gt;$SPLUNK_HOME/etc/system/local/props.conf&lt;/CODE&gt;  (You noted "sys" instead of "system" in your original question, but I'm assuming that was just a shortcut notation which I get, but splunk would not.)&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;See this link for more &lt;A href="http://answers.splunk.com/questions/4075/whats-the-best-way-to-track-down-props-conf-problems/4080#4080" rel="nofollow"&gt;props debugging techniques&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2010 02:58:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16072#M1880</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-06-25T02:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Timestamps</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16073#M1881</link>
      <description>&lt;P&gt;I entered in the suggested code for props.conf and it still does not extract the correct time.  I really don't know why it will not take it.  It acts like it doesn't even read the [dns_data] stanza.  Would there be any other reason why it would not read it or act upon it?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2010 22:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16073#M1881</guid>
      <dc:creator>mawwx3</dc:creator>
      <dc:date>2010-06-25T22:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Timestamps</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16074#M1882</link>
      <description>&lt;P&gt;I've added a few more config testing ideas to my answer.  Best of luck.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2010 02:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16074#M1882</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-06-26T02:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Timestamps</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16075#M1883</link>
      <description>&lt;P&gt;Note that Lowell's TIME_PREFIX skips over the day of the week, and yours doesn't.  That's pretty key.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Jun 2010 05:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Multiple-Timestamps/m-p/16075#M1883</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2010-06-26T05:13:29Z</dc:date>
    </item>
  </channel>
</rss>

