<?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 the output results based on custom date range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366233#M108016</link>
    <description>&lt;P&gt;Is each line with an outputdate its own event? Is outputdate the timestamp of your event?&lt;/P&gt;</description>
    <pubDate>Sat, 06 May 2017 07:42:52 GMT</pubDate>
    <dc:creator>ckunath</dc:creator>
    <dc:date>2017-05-06T07:42:52Z</dc:date>
    <item>
      <title>Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366232#M108015</link>
      <description>&lt;P&gt;I want to filter the output based on the below time format,  I want keep only results until 12am not after 12am. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Outputdate
05/05/2017 14:50:22.970
05/05/2017 11:50:22.230
05/05/2017 10:40:22.137
05/05/2017 06:10:22.690
05/05/2017 03:35:22.340
05/04/2017 23:50:22.901
05/04/2017 21:50:22.620
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If my alert trigger at 3pm or 9am any day, it should only contain results till 12am that early morning. &lt;/P&gt;

&lt;P&gt;Desired output should be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05/04/2017 23:50:22.901
05/04/2017 21:50:22.620
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried to use eval and relative time like where &lt;CODE&gt;outputeval&amp;gt;=relative_time(outputdate,"-1d")&lt;/CODE&gt; but it doesn't work. Is there any other way to get the results only till 12am on that day or 23:59 last day ? This data is coming from Database and not traditional log events.&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 04:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366232#M108015</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2017-05-06T04:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366233#M108016</link>
      <description>&lt;P&gt;Is each line with an outputdate its own event? Is outputdate the timestamp of your event?&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 07:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366233#M108016</guid>
      <dc:creator>ckunath</dc:creator>
      <dc:date>2017-05-06T07:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366234#M108017</link>
      <description>&lt;P&gt;Hi ibob0304,&lt;BR /&gt;
you have to insert in you search the additional condition &lt;CODE&gt;date_hour&amp;lt;12&lt;/CODE&gt;, e.g.:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search date_hour&amp;lt;12 
| ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 08:50:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366234#M108017</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-05-06T08:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366235#M108018</link>
      <description>&lt;P&gt;This doesnt work because my data comes from db and no physical logs &lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 12:44:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366235#M108018</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2017-05-06T12:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366236#M108019</link>
      <description>&lt;P&gt;there are no traditional events, data comes from database, and each row has its own outputdate..&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 12:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366236#M108019</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2017-05-06T12:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366237#M108020</link>
      <description>&lt;P&gt;This means that the date to manipulate is in a field (e.g. your_field_date), the logic is the same, try something like this:&lt;BR /&gt;
your_search&lt;BR /&gt;
| eval datehour=strftime(strptime(your_field_date,"%m/%d/%Y %H:%M:%S.%3N","%H")&lt;BR /&gt;
| where datehour&amp;lt;12&lt;BR /&gt;
| ...&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:58:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366237#M108020</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T13:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366238#M108021</link>
      <description>&lt;P&gt;ok this means that the date to use for check in in a different field (e.g. called your_field_date), the logic is the same, try something like this:&lt;BR /&gt;
your_search&lt;BR /&gt;
| eval datehour=strftime(strptime(your_field_date,"%m/%d/%Y %H:%M:%S.%3N"),"%H")&lt;BR /&gt;
| where datehour&amp;lt;12&lt;BR /&gt;
| ...&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366238#M108021</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T13:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366239#M108022</link>
      <description>&lt;P&gt;Add this to the end of your search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval date_hourmin = strftime(strptime(Outputdate,"%m/%d/%Y %H:%M:%S.%3N"), "%H%M")
| search date_hourmin &amp;gt;= 1200
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 May 2017 15:48:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366239#M108022</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-06T15:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366240#M108023</link>
      <description>&lt;P&gt;This is filtering all data including old days.. I have 6000 records till today morning 7am, after applying above filter it is searching only &amp;gt;=1200 for all days and got only 3000ish records.  But I just want filter for sameday or on that particular day. Till 12am today there are 5900records and I want the output of 5900records by filtering current day records.  So when ever I run the report, it should keep all the records and remove current day results after 12am. &lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 14:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366240#M108023</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2017-05-07T14:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366241#M108024</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| eval myDate=relative_time(now(),"-8h") | convert ctime(myDate)
| search  Outputdate &amp;lt; myDate
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried this but this has to modify accordingly based on &lt;CODE&gt;alert trigger time - output time..&lt;/CODE&gt;  I am looking for some dynamic query which can exclude all today results.&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 17:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366241#M108024</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2017-05-07T17:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Filter the output results based on custom date range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366242#M108025</link>
      <description>&lt;P&gt;Based on your clarification, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval myDate=relative_time(now(), "@d+12h")
| search  Outputdate &amp;lt; myDate
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 May 2017 18:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-the-output-results-based-on-custom-date-range/m-p/366242#M108025</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-07T18:23:30Z</dc:date>
    </item>
  </channel>
</rss>

