<?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: Filter records using time modifiers in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331324#M61388</link>
    <description>&lt;P&gt;Now() is already in epochtime.&lt;BR /&gt;
you can see with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | head 1 | eval late=now() | table late
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;beware that in your eval command you losed one %.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jul 2017 10:17:27 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-07-27T10:17:27Z</dc:date>
    <item>
      <title>Filter records using time modifiers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331321#M61385</link>
      <description>&lt;P&gt;Can someone tell me why this is not working:-&lt;/P&gt;

&lt;P&gt;I need to filter records having 'Start_Time' within the mentioned range:&lt;/P&gt;

&lt;P&gt;Working:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=imt_mobile source="*LTS_Validation_1" |eval early=relative_time(now(),"-3w@w")|eval late=relative_time(now(),"-2w@w")| where Start_Time&amp;lt;late|table   "Track" "CO" early  Start_Time late|
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3260iAE9A7546424D4692/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Here Start_Time was before 'late' so coming fine.&lt;/P&gt;

&lt;P&gt;Not Working:-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=imt_mobile source="*LTS_Validation_1" |eval early=relative_time(now(),"-3w@w")|eval late=relative_time(now(),"-2w@w")| where Start_Time&amp;lt;"-2w@w"|table   "Track" "CO" early  Start_Time late|
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3261iAE8E440B810EDC6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Here it is not working!!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 07:23:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331321#M61385</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-27T07:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records using time modifiers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331322#M61386</link>
      <description>&lt;P&gt;Hi dsiob,&lt;BR /&gt;
sorry but I don't understand your problem:&lt;BR /&gt;
in a where condition you have to compare two similar fields: if you use " &lt;CODE&gt;-2w@w&lt;/CODE&gt; " Splunk don't understand that you're speaking about a time in epochtime format, so you need to transform "-2w@w" in epochtime format to compare with StartTime.&lt;BR /&gt;
To do this you have to use (as in your first example) &lt;CODE&gt;|eval late=relative_time(now(),"-2w@w")| where Start_Time&amp;lt;late&lt;/CODE&gt;&lt;BR /&gt;
So, what is the problem to use eval?&lt;BR /&gt;
If instead you need to show in Human readable format the three dates use strftime command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval early=strftime(early,"%d/m/%Y %H.%M.%S"), late=strftime(late,"%d/m/%Y %H.%M.%S"), StartTime=strftime(StartTime,"%d/m/%Y %H.%M.%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 08:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331322#M61386</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-27T08:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records using time modifiers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331323#M61387</link>
      <description>&lt;P&gt;so in place of "-2w@w" I need to use $mytime.Latest$, If I go with  eval late=strftime(late,"%d/m/%Y %H.%M.%S") then It does not work If value of $mytime.Latest$ is "now". It is not able to convert "now" to epochtime&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 09:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331323#M61387</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-27T09:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Filter records using time modifiers</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331324#M61388</link>
      <description>&lt;P&gt;Now() is already in epochtime.&lt;BR /&gt;
you can see with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | head 1 | eval late=now() | table late
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;beware that in your eval command you losed one %.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jul 2017 10:17:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Filter-records-using-time-modifiers/m-p/331324#M61388</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-27T10:17:27Z</dc:date>
    </item>
  </channel>
</rss>

