<?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: props.conf entries in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35966#M6561</link>
    <description>&lt;P&gt;What you have configured so far is probably not what you want.  You have told Splunk how to do timestamp recognition for three different sourcetypes, &lt;CODE&gt;lasttime&lt;/CODE&gt;, &lt;CODE&gt;firsttime&lt;/CODE&gt;, and &lt;CODE&gt;actiontime&lt;/CODE&gt;.  I doubt that your sample event is any of these three sourcetypes, and am 100% confident that it is not all three at once.&lt;/P&gt;

&lt;P&gt;I am going to make an assumption that your firsttime, lasttime, and actiontime are all within a single event and that, thanks to auto-kv extraction, they are already pulled out as fields.  To do your comparison, the easiest thing to do is yank them into &lt;CODE&gt;time_t&lt;/CODE&gt; values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mysourcetype 
| eval firsttime_t=strptime(firsttime,"%Y/%m/%/d %H:%M:%S")
| eval lasttime_t=strptime(lasttime,"%Y/%m/%/d %H:%M:%S")
| eval actiontime_t=strptime(actiontime,"%Y/%m/%/d %H:%M:%S")
| where firsttime_t &amp;lt;= (now() - (86400 * 5))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Aug 2012 14:56:17 GMT</pubDate>
    <dc:creator>dwaddle</dc:creator>
    <dc:date>2012-08-16T14:56:17Z</dc:date>
    <item>
      <title>props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35961#M6556</link>
      <description>&lt;P&gt;I need to perform some date calculations in my app.  Every entry in my logs will have multiple custom dates that I need to query.  The time formats in the logs look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;firsttime=2012/08/10 22:14:13
actiontime=2012/08/11 10:25:03
lasttime=2012/08/12 12:23:26
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've entered the following in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[lasttime]
TIME_PREFIX = lasttime
FORMAT = %Y/%m/%/d %H:%M:%S

[firsttime]
TIME_PREFIX = firsttime
FORMAT = %Y/%m/%/d %H:%M:%S

[actiontime]
TIME_PREFIX = actionTime
FORMAT = %Y/%m/%/d %H:%M:%S
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this format accurate?  If so, how to run a query for all lines where (for example) firsttime is older then 5 days?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2012 18:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35961#M6556</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-08-15T18:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35962#M6557</link>
      <description>&lt;P&gt;Wait, are you saying that these events all have their own sourcetype, so the one with "firsttime" actually has sourcetype "firsttime" and so on? Because the stanzas you've defined in props.conf seem to suggest that.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2012 18:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35962#M6557</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-15T18:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35963#M6558</link>
      <description>&lt;P&gt;Can you provide a few lines of one of the logs?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2012 18:51:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35963#M6558</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-08-15T18:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35964#M6559</link>
      <description>&lt;P&gt;ticketNumber=1|firstTime=2012/07/25 10:20:18|lastTime=2012/07/25 09:36:17|writeTime=2012/07/25 18:23:58|actionCode=U|actionTime=2012/07/25&lt;/P&gt;

&lt;P&gt;A single line, the rest would be the same, with different times.  I'd like to be able to run a query to find all lines in a log where firstTime is older then 5 days.  I know this can be accomplished using regular expressions, but I want to get away from that.  Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2012 14:24:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35964#M6559</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-08-16T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35965#M6560</link>
      <description>&lt;P&gt;I think you're confusing some concepts here.&lt;/P&gt;

&lt;P&gt;First of all, stanzas in props.conf refer to what type of events something should apply to - most commonly this is a sourcetype, like in your props.conf where you have for instance a stanza &lt;CODE&gt;[actiontime]&lt;/CODE&gt;. That's telling Splunk that the settings below the stanza should apply to the &lt;EM&gt;sourcetype&lt;/EM&gt; &lt;CODE&gt;actiontime&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Second, there is no &lt;CODE&gt;FORMAT&lt;/CODE&gt; configuration directive in &lt;CODE&gt;props.conf&lt;/CODE&gt;. There IS a directive called &lt;CODE&gt;TIME_FORMAT&lt;/CODE&gt;, but that only applies to how Splunk should parse a timestamp in an event for creating its own event timestamp (&lt;CODE&gt;_time&lt;/CODE&gt;).&lt;/P&gt;

&lt;P&gt;If you want to make use of &lt;CODE&gt;strftime/strptime&lt;/CODE&gt; format strings for extracting time values from timestamp strings, you should use &lt;CODE&gt;eval&lt;/CODE&gt;'s &lt;CODE&gt;strftime&lt;/CODE&gt; and &lt;CODE&gt;strptime&lt;/CODE&gt; functions, or possibly the &lt;CODE&gt;convert&lt;/CODE&gt; command. More information on &lt;CODE&gt;eval&lt;/CODE&gt;, its functions and finally &lt;CODE&gt;convert&lt;/CODE&gt;, respectively, can be found at the following sections in the docs:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Convert"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Convert&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2012 14:40:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35965#M6560</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-16T14:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35966#M6561</link>
      <description>&lt;P&gt;What you have configured so far is probably not what you want.  You have told Splunk how to do timestamp recognition for three different sourcetypes, &lt;CODE&gt;lasttime&lt;/CODE&gt;, &lt;CODE&gt;firsttime&lt;/CODE&gt;, and &lt;CODE&gt;actiontime&lt;/CODE&gt;.  I doubt that your sample event is any of these three sourcetypes, and am 100% confident that it is not all three at once.&lt;/P&gt;

&lt;P&gt;I am going to make an assumption that your firsttime, lasttime, and actiontime are all within a single event and that, thanks to auto-kv extraction, they are already pulled out as fields.  To do your comparison, the easiest thing to do is yank them into &lt;CODE&gt;time_t&lt;/CODE&gt; values.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mysourcetype 
| eval firsttime_t=strptime(firsttime,"%Y/%m/%/d %H:%M:%S")
| eval lasttime_t=strptime(lasttime,"%Y/%m/%/d %H:%M:%S")
| eval actiontime_t=strptime(actiontime,"%Y/%m/%/d %H:%M:%S")
| where firsttime_t &amp;lt;= (now() - (86400 * 5))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Aug 2012 14:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35966#M6561</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2012-08-16T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: props.conf entries</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35967#M6562</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Aug 2012 16:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/props-conf-entries/m-p/35967#M6562</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-08-17T16:07:48Z</dc:date>
    </item>
  </channel>
</rss>

