<?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: Command Line Search with Time Frame in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17108#M2340</link>
    <description>&lt;P&gt;I understand this. This works in the GUI. But not as a command.&lt;/P&gt;

&lt;P&gt;Right now, my command is 'splunk search source="/var/log/secure" "invalid user"'&lt;/P&gt;

&lt;P&gt;This works, but retrieves all events. I want to retrieve events from only the last fifteen minutes.&lt;/P&gt;

&lt;P&gt;If I try 'splunk search source="/var/log/secure" earliest=-15m "invalid user"' it will still retrieve all events.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jul 2010 22:15:00 GMT</pubDate>
    <dc:creator>jkfierro</dc:creator>
    <dc:date>2010-07-09T22:15:00Z</dc:date>
    <item>
      <title>Command Line Search with Time Frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17106#M2338</link>
      <description>&lt;P&gt;I am running version 4.1.2.&lt;/P&gt;

&lt;P&gt;I am trying to complete a search of a source using the command line tools. I need to specify a time frame as well, perhaps "the last fifteen minutes" for example. I am able to do this within the GUI using some of the time functions, but none of those work in command line.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2010 21:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17106#M2338</guid>
      <dc:creator>jkfierro</dc:creator>
      <dc:date>2010-07-09T21:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Command Line Search with Time Frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17107#M2339</link>
      <description>&lt;P&gt;You can just add the parameters "earliest=" and/or "latest=" to your search terms, e.g:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=xx "search 1" "term2" earliest=-15m | stats count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/User/ChangeTheTimeRangeOfYourSearch#Syntax_for_relative_time_modifiers" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/User/ChangeTheTimeRangeOfYourSearch#Syntax_for_relative_time_modifiers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2010 22:04:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17107#M2339</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-07-09T22:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Command Line Search with Time Frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17108#M2340</link>
      <description>&lt;P&gt;I understand this. This works in the GUI. But not as a command.&lt;/P&gt;

&lt;P&gt;Right now, my command is 'splunk search source="/var/log/secure" "invalid user"'&lt;/P&gt;

&lt;P&gt;This works, but retrieves all events. I want to retrieve events from only the last fifteen minutes.&lt;/P&gt;

&lt;P&gt;If I try 'splunk search source="/var/log/secure" earliest=-15m "invalid user"' it will still retrieve all events.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2010 22:15:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17108#M2340</guid>
      <dc:creator>jkfierro</dc:creator>
      <dc:date>2010-07-09T22:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Command Line Search with Time Frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17109#M2341</link>
      <description>&lt;P&gt;The search string must be passed as a single argument on the command line. Generally the easiest way to do this in the shell is to quote the entire search string within single quotes.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2010 04:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17109#M2341</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-07-10T04:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Command Line Search with Time Frame</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17110#M2342</link>
      <description>&lt;P&gt;I found this question because it appeared that my CLI search was not returning events beyond the current day. I first thought it was because i didn't specify a time range. &lt;/P&gt;

&lt;P&gt;I discovered that the CLI search is limited by 100 results by default. This can be changed with the argument -maxout 0  for all results.  &lt;/P&gt;

&lt;P&gt;Example:  ./splunk search 'gfriedmann earliest=-7d' -maxout 200&lt;/P&gt;

&lt;P&gt;You may also use -maxout 0 for unlimited. &lt;/P&gt;

&lt;P&gt;Be careful, though.  I think CLI searches won't timeout, so it may keep chugging for a LONG time if you dont' limit it properly. &lt;/P&gt;

&lt;P&gt;More info: &lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/CLIsearchsyntax" rel="nofollow"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/CLIsearchsyntax&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2010 04:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Command-Line-Search-with-Time-Frame/m-p/17110#M2342</guid>
      <dc:creator>gfriedmann</dc:creator>
      <dc:date>2010-11-23T04:38:55Z</dc:date>
    </item>
  </channel>
</rss>

