<?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: Field _time should be less than a week in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100685#M26003</link>
    <description>&lt;P&gt;Its custom time, so not possible to set the time range. Following search worked for me.&lt;/P&gt;

&lt;P&gt;... | convert timeformat="%m/%e/%Y %I:%M:%S %p" mktime(Time) AS Time_epoch mktime(now) AS now_epoch | eval age=round((Time_epoch-now_epoch)/60/60/24)&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 14:23:38 GMT</pubDate>
    <dc:creator>d12harshal</dc:creator>
    <dc:date>2020-09-28T14:23:38Z</dc:date>
    <item>
      <title>Field _time should be less than a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100683#M26001</link>
      <description>&lt;P&gt;Dear Splunkers,&lt;BR /&gt;
My search results contain fields &lt;STRONG&gt;Name, Time&lt;/STRONG&gt; as Test1, Test2, Test3, Test4 and 1375351200.000, 1417863600.000, 1375351200.000, 1375351200.000&lt;/P&gt;

&lt;P&gt;My Requirement: I trying to convert time to human readable standard format, and also final report must only contain a report with time(date) less than a week. Adding of extra fields also not a problem.&lt;/P&gt;

&lt;P&gt;Could any please help me out. Thanks in advance.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Harshal&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2013 08:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100683#M26001</guid>
      <dc:creator>d12harshal</dc:creator>
      <dc:date>2013-07-19T08:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Field _time should be less than a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100684#M26002</link>
      <description>&lt;P&gt;Add the following and then add the field time to your table.&lt;BR /&gt;
| convert ctime(_time) as time&lt;/P&gt;

&lt;P&gt;Then set your search range for past seven days or specify the time range in the time range picker.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2013 12:28:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100684#M26002</guid>
      <dc:creator>jgedeon120</dc:creator>
      <dc:date>2013-07-19T12:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Field _time should be less than a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100685#M26003</link>
      <description>&lt;P&gt;Its custom time, so not possible to set the time range. Following search worked for me.&lt;/P&gt;

&lt;P&gt;... | convert timeformat="%m/%e/%Y %I:%M:%S %p" mktime(Time) AS Time_epoch mktime(now) AS now_epoch | eval age=round((Time_epoch-now_epoch)/60/60/24)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100685#M26003</guid>
      <dc:creator>d12harshal</dc:creator>
      <dc:date>2020-09-28T14:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Field _time should be less than a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100686#M26004</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am not sure why "mktime" instead "ctime" was used here.&lt;/P&gt;

&lt;P&gt;I would suggest the following search command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | convert timeformat="%m/%d/%y %H:%M:%S" ctime(Time) as NewTime | where now() - Time &amp;lt; 604800
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if it works for you.&lt;/P&gt;

&lt;P&gt;EDIT: Just realized that earliest will work for "_time" field only which is not the time field for your case. So modified the search query to use "now". However the newer search might not work in all cases. The number 604800 is equal to number of seconds in a week.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Saxena&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2013 13:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100686#M26004</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-28T13:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Field _time should be less than a week</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100687#M26005</link>
      <description>&lt;P&gt;Sorry it was a long time, but in my case it is not possible with ctime.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 10:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-time-should-be-less-than-a-week/m-p/100687#M26005</guid>
      <dc:creator>d12harshal</dc:creator>
      <dc:date>2013-08-14T10:59:41Z</dc:date>
    </item>
  </channel>
</rss>

