<?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: How to filter date based on the future data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366684#M164173</link>
    <description>&lt;P&gt;If i have understood correctly, you should be able to use time snapping for this:&lt;/P&gt;

&lt;P&gt;If you set your earliest search time to &lt;CODE&gt;-1mon@mon&lt;/CODE&gt; it will restrict the search to events which have only occurred since the 1st day of the current month.&lt;/P&gt;

&lt;P&gt;See &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/SearchTimeModifiers"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/SearchTimeModifiers&lt;/A&gt; for more details.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2017 09:16:29 GMT</pubDate>
    <dc:creator>nickhills</dc:creator>
    <dc:date>2017-12-27T09:16:29Z</dc:date>
    <item>
      <title>How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366679#M164168</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;

&lt;P&gt;I have a Session_Start_Date field that needed to be filter. The condition is that, for example, the data upload were at October 2017, the session start date field needs to be filtered 1 month onward from October. so I need to get the datas starting Nov onwards since this is a future report. Is there any way to do this?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366679#M164168</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2020-09-29T17:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366680#M164169</link>
      <description>&lt;P&gt;Please give some example on what you are looking for and the sample output.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 08:46:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366680#M164169</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2017-12-27T08:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366681#M164170</link>
      <description>&lt;P&gt;Hi @Kwip&lt;/P&gt;

&lt;P&gt;for example, I have a date below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Session_Start_Date

10/30/2017
9/25/2017
11/15/2017
11/26/2017
9/25/2017

This is a data for the month of October, I only need to get the date starting November onward. The data is uploaded monthly.
So for example the month is November, I need to get the data starting December onward. Hope this helps. Thank you.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:03:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366681#M164170</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2017-12-27T09:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366682#M164171</link>
      <description>&lt;P&gt;so the output should only be 11/25/2017 and 11/26/2017.&lt;/P&gt;

&lt;P&gt;My previous code is:&lt;/P&gt;

&lt;P&gt;| where strptime('Session_Start_Date',"%m/%d/%Y") &amp;gt;= strptime("11/1/2017","%m/%d/%Y")&lt;/P&gt;

&lt;P&gt;But since data is uploaded monthly, the date should not be hardcoded like the 11/1/2017.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366682#M164171</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2020-09-29T17:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366683#M164172</link>
      <description>&lt;P&gt;Hi @mrccasi,&lt;BR /&gt;
could you check if below splunk docs helps you.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Whitelistorblacklistspecificincomingdata"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Data/Whitelistorblacklistspecificincomingdata&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:10:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366683#M164172</guid>
      <dc:creator>nikita_p</dc:creator>
      <dc:date>2017-12-27T09:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366684#M164173</link>
      <description>&lt;P&gt;If i have understood correctly, you should be able to use time snapping for this:&lt;/P&gt;

&lt;P&gt;If you set your earliest search time to &lt;CODE&gt;-1mon@mon&lt;/CODE&gt; it will restrict the search to events which have only occurred since the 1st day of the current month.&lt;/P&gt;

&lt;P&gt;See &lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/SearchTimeModifiers"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/SearchReference/SearchTimeModifiers&lt;/A&gt; for more details.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 09:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366684#M164173</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2017-12-27T09:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366685#M164174</link>
      <description>&lt;P&gt;I am assuming you have field called  Session_Start_Date and that field values are in the format given below,&lt;BR /&gt;
mm/dd/yyyy&lt;BR /&gt;
 10/30/2017&lt;BR /&gt;
 9/25/2017&lt;BR /&gt;
 11/15/2017&lt;BR /&gt;
 11/26/2017&lt;BR /&gt;
 9/25/2017&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base query
| rex field=Session_Start_Date"(?&amp;lt;Report_Month&amp;gt;\d{1,2})" 
| stats count by Report_Month 
| search Report_Month&amp;gt;10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query will rex the field Session_Start_Date and take first one OR two digit as Month and assign to the field Report_Month. So once you are search for the Report_Month  value greater than the current month value you can get the result you are looking for.&lt;/P&gt;

&lt;P&gt;Please check and let me know if you face any issues.&lt;BR /&gt;
You can use table or stats with the fields you want to use.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366685#M164174</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2020-09-29T17:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366686#M164175</link>
      <description>&lt;P&gt;I am assuming you have field called  Session_Start_Date and that field values are in the format given below,&lt;BR /&gt;
mm/dd/yyyy&lt;BR /&gt;
 10/30/2017&lt;BR /&gt;
 9/25/2017&lt;BR /&gt;
 11/15/2017&lt;BR /&gt;
 11/26/2017&lt;BR /&gt;
 9/25/2017&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base query
| rex field=Session_Start_Date"(?&amp;lt;Report_Month&amp;gt;\d{1,2})" 
| stats count by Report_Month 
| search Report_Month&amp;gt;10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The above query will rex the field Session_Start_Date and take first one OR two digit as Month and assign to the Report_Month. So once you are search for the Report_Month  value greater than the current month value you can get the result you are looking for.&lt;/P&gt;

&lt;P&gt;Please check and let me know if you face any issues.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366686#M164175</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2020-09-29T17:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366687#M164176</link>
      <description>&lt;P&gt;[base of your search ] earliest=[ search ...search_to_restrict_session_start_date|  eval date=strptime(Session_Start_Date, "%m/%d/%Y") | eval date=relative_time(date, "+1mon@mon") | return $date]...&lt;/P&gt;

&lt;P&gt;So you will get events starting from the beginning of next month after selected Session_Start_Date&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:26:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366687#M164176</guid>
      <dc:creator>andrey2007</dc:creator>
      <dc:date>2020-09-29T17:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter date based on the future data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366688#M164177</link>
      <description>&lt;P&gt;Hello -&lt;/P&gt;

&lt;P&gt;Thank you. I've tried your query but the issue is when the month is november which is 11 it should get the data for january onwards. So i dont think the&lt;/P&gt;

&lt;P&gt;| search Report_Month&amp;gt;10 query is okay? and since January is 01, i dont know if &amp;gt; can be use.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 02:32:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-date-based-on-the-future-data/m-p/366688#M164177</guid>
      <dc:creator>mrccasi</dc:creator>
      <dc:date>2017-12-28T02:32:07Z</dc:date>
    </item>
  </channel>
</rss>

