<?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 limit number of rows by searching for begin date &amp;gt; 12/31/2009 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118062#M31470</link>
    <description>&lt;P&gt;martin_mueller,&lt;/P&gt;

&lt;P&gt;How do you extract the day, month and year as individual fields?  Would you please provide an example?&lt;BR /&gt;
Thanks,&lt;/P&gt;

&lt;P&gt;JK&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2014 17:56:45 GMT</pubDate>
    <dc:creator>quanteq</dc:creator>
    <dc:date>2014-06-24T17:56:45Z</dc:date>
    <item>
      <title>How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118058#M31466</link>
      <description>&lt;P&gt;My basic search is :  eventtype=FAS &lt;BR /&gt;
Gives the following results:&lt;BR /&gt;
RESP    BEGIN DATE  FISCAL YEAR PLACE &lt;BR /&gt;
Yes 12/22/2009  2010            VT&lt;BR /&gt;
Yes 11/18/2010  2011            VT&lt;BR /&gt;
Yes 11/15/2012  2013            FL&lt;BR /&gt;
Yes 8/7/2009    2009            VT&lt;BR /&gt;
Yes 8/6/2009    2009            VT&lt;BR /&gt;
Yes 5/20/2011   2011            VT&lt;BR /&gt;
Yes 1/21/2009   2009            VT&lt;BR /&gt;
Yes 1/11/2011   2011            FL&lt;BR /&gt;
……&lt;/P&gt;

&lt;P&gt;How can I limit my search using dates &amp;gt; than 8/31/2009?&lt;BR /&gt;
The  following gives unpredictable results:&lt;/P&gt;

&lt;P&gt;eventtype=FAS  " BEGIN DATE "&amp;gt;"12/31/2009"&lt;/P&gt;

&lt;P&gt;Thanks!&lt;BR /&gt;
JK&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 15:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118058#M31466</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-24T15:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118059#M31467</link>
      <description>&lt;P&gt;Splunk does not have a data type of date, so your search is looking at the date as a string. Try this, which assumes that there is actually a field named &lt;CODE&gt;BEGIN DATE&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=FAS 
| eval begin_date = strptime('BEGIN DATE',"%m/%d/%Y") 
| where begin_date &amp;gt; strptime("12/31/2009","%m/%d/%Y") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jun 2014 16:28:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118059#M31467</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-06-24T16:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118060#M31468</link>
      <description>&lt;P&gt;You could extract the day, month, and year as individual fields and filter based on that. For &lt;CODE&gt;&amp;gt;12/31/2009&lt;/CODE&gt; you'd just filter by &lt;CODE&gt;year&amp;gt;2009&lt;/CODE&gt;, for &lt;CODE&gt;&amp;gt;8/31/2009&lt;/CODE&gt; you'd filter by &lt;CODE&gt;year&amp;gt;2009 OR (year=2009 month&amp;gt;8)&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 16:41:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118060#M31468</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-24T16:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118061#M31469</link>
      <description>&lt;P&gt;Iguinn,&lt;/P&gt;

&lt;P&gt;This will do. Thanks for your help! &lt;/P&gt;

&lt;P&gt;JK&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 16:41:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118061#M31469</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-24T16:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118062#M31470</link>
      <description>&lt;P&gt;martin_mueller,&lt;/P&gt;

&lt;P&gt;How do you extract the day, month and year as individual fields?  Would you please provide an example?&lt;BR /&gt;
Thanks,&lt;/P&gt;

&lt;P&gt;JK&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 17:56:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118062#M31470</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-24T17:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118063#M31471</link>
      <description>&lt;P&gt;That depends on your raw data. Assuming it looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;something begin_date=12/31/2009 something else
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could use this expression:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;begin_date=(?&amp;lt;month&amp;gt;\d+)/(?&amp;lt;day&amp;gt;\d+)/(?&amp;lt;year&amp;gt;\d+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jun 2014 17:59:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118063#M31471</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-24T17:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118064#M31472</link>
      <description>&lt;P&gt;Iguinn,&lt;/P&gt;

&lt;P&gt;What alternatives are there to using "eventtype" if I cannot create one with the results of this query?&lt;BR /&gt;
Eventtype search string cannot be a search pipeline or contain a subsearch. &lt;BR /&gt;
Thanks!&lt;BR /&gt;
JK&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118064#M31472</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-24T18:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118065#M31473</link>
      <description>&lt;P&gt;You could move those two commands into a macro to avoid typing the whole shebang into many searches.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 18:02:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118065#M31473</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-24T18:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118066#M31474</link>
      <description>&lt;P&gt;The raw data looks like this: BEGIN DATE = 12/31/2009&lt;BR /&gt;
 (please note the space between BEGIN DATE)&lt;/P&gt;

&lt;P&gt;I tried the following and showed no syntax errors but did not get any results from the query.  What am I missing?&lt;/P&gt;

&lt;P&gt;eventtype=FAS &lt;BR /&gt;
| eval 'BEGIN DATE'="(?&lt;MONTH&gt;\d+)/(?&lt;DAY&gt;\d+)/(?&lt;YEAR&gt;\d+)"&lt;BR /&gt;
| where year&amp;gt;2009 OR (year=2009 AND month&amp;gt;8)&lt;/YEAR&gt;&lt;/DAY&gt;&lt;/MONTH&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2014 19:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118066#M31474</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-24T19:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118067#M31475</link>
      <description>&lt;P&gt;&lt;CODE&gt;eval&lt;/CODE&gt; doesn't do field extraction. Either add a field extraction through Settings -&amp;gt; Fields -&amp;gt; Field extractions, or use &lt;CODE&gt;rex&lt;/CODE&gt; in the search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=FAS | rex "BEGIN DATE = (?&amp;lt;month&amp;gt;\d+)/(?&amp;lt;day&amp;gt;\d+)/(?&amp;lt;year&amp;gt;\d+)" | where year&amp;gt;2009 OR (year=2009 AND month&amp;gt;8)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jun 2014 19:06:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118067#M31475</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-24T19:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118068#M31476</link>
      <description>&lt;P&gt;I tried:&lt;BR /&gt;
eventtype=FAS | rex "BEGIN DATE = (?&lt;MONTH&gt;\d+)/(?&lt;DAY&gt;\d+)/(?&lt;YEAR&gt;\d+)" | where year&amp;gt;2009 OR (year=2009 AND month&amp;gt;8) but could not get any results. I am still curious as to why it didn't work.&lt;/YEAR&gt;&lt;/DAY&gt;&lt;/MONTH&gt;&lt;/P&gt;

&lt;P&gt;Then I took another route:&lt;/P&gt;

&lt;P&gt;eventtype=FAS |eval begin_month = strftime(strptime('BEGIN DATE',"%m/%d/%Y") ,"%m")|eval begin_Year = strftime(strptime('BEGIN DATE',"%m/%d/%Y") ,"%Y")|where begin_Year &amp;gt; 2009 OR  (begin_Year = 2009 AND begin_month&amp;gt;8)&lt;/P&gt;

&lt;P&gt;Thank you for your comments!&lt;BR /&gt;
JK&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:55:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118068#M31476</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2020-09-28T16:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118069#M31477</link>
      <description>&lt;P&gt;eventtype=FAS |eval begin_month = strftime(strptime('BEGIN DATE',"%m/%d/%Y") ,"%m")|eval begin_Year = strftime(strptime('BEGIN DATE',"%m/%d/%Y") ,"%Y")|where begin_Year &amp;gt; 2009 OR (begin_Year = 2009 AND begin_month&amp;gt;8)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:55:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118069#M31477</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2020-09-28T16:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118070#M31478</link>
      <description>&lt;P&gt;In Splunk 6.1, you can create a calculated field named &lt;CODE&gt;begin_date&lt;/CODE&gt; using the second line of the search above as a pattern. Once you have that field, your search would be&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eventtype=FAS begin_date&amp;gt; 1262303999&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Because &lt;CODE&gt;1262303999&lt;/CODE&gt; is 12/31/2009 23:59:59 in epoch time. (I used a time converter to figure that out.)&lt;/P&gt;

&lt;P&gt;This technique should allow you to save the resulting search as an eventtype&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 00:43:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118070#M31478</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-06-25T00:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118071#M31479</link>
      <description>&lt;P&gt;Leave off the &lt;CODE&gt;where&lt;/CODE&gt; and confirm that you have a &lt;CODE&gt;year&lt;/CODE&gt;, &lt;CODE&gt;month&lt;/CODE&gt;, and &lt;CODE&gt;day&lt;/CODE&gt; field.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 07:04:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118071#M31479</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-25T07:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118072#M31480</link>
      <description>&lt;P&gt;Thanks!  JK&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 14:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118072#M31480</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-25T14:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118073#M31481</link>
      <description>&lt;P&gt;I found the following:&lt;/P&gt;

&lt;P&gt;Prior to 1972, this time was called Greenwich Mean Time (GMT) but is now referred to as Coordinated Universal Time or Universal Time Coordinated (UTC)&lt;/P&gt;

&lt;P&gt;I found this link to do the conversion:&lt;BR /&gt;
&lt;A href="http://www.freeformatter.com/epoch-timestamp-to-date-converter.html"&gt;http://www.freeformatter.com/epoch-timestamp-to-date-converter.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;For GMT:&lt;BR /&gt;
Thu, 31 Dec 2009 23:59:59&lt;BR /&gt;
1262239200&lt;/P&gt;

&lt;P&gt;For Local:&lt;BR /&gt;
12/31/2009 23:59:59 gives &lt;BR /&gt;
1262325599&lt;/P&gt;

&lt;P&gt;How do you know which one to use?&lt;BR /&gt;
The other question is, since I am getting a variable named: "BEGIN DATE", how do I create an alias or rename it to: "begin_date"?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;BR /&gt;
JK&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 15:14:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118073#M31481</guid>
      <dc:creator>quanteq</dc:creator>
      <dc:date>2014-06-25T15:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of rows by searching for begin date &gt; 12/31/2009</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118074#M31482</link>
      <description>&lt;P&gt;Just use Splunk to convert the time:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | eval timestamp = strptime("2010-01-01 00:00:00", "%F %T")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should yield 1262300400.&lt;/P&gt;

&lt;P&gt;As for aliases, take a look at Settings -&amp;gt; Fields -&amp;gt; Field Aliases.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2014 21:39:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-number-of-rows-by-searching-for-begin-date-gt-12-31/m-p/118074#M31482</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-25T21:39:44Z</dc:date>
    </item>
  </channel>
</rss>

