<?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: Is it possible to use earliest twice in one search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198390#M57354</link>
    <description>&lt;P&gt;A Point to add here:&lt;BR /&gt;
Searching each time range separately has the earliest and latest times set correctly, but searching them with an OR in between made it so that it windowed the search by the range of the time picker in the search bar. So if that were set to, say, "All Time," it would search over the entire contents of your sourcetypes just to pull out data between those two date ranges. By the same token, if it were set to "Today", it would cut off entries outside of today and give you an incomplete answer. (And if it were set to something that didn't overlap with either of the date ranges in the search, it would give you an error.)&lt;/P&gt;</description>
    <pubDate>Fri, 26 Sep 2014 05:41:02 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2014-09-26T05:41:02Z</dc:date>
    <item>
      <title>Is it possible to use earliest twice in one search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198386#M57350</link>
      <description>&lt;P&gt;will it work:&lt;BR /&gt;
(earliest=-1d@d latest=@d sourcetype=a) OR (earliest=-1d@d sourcetype=b)&lt;BR /&gt;
?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2014 09:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198386#M57350</guid>
      <dc:creator>0range</dc:creator>
      <dc:date>2014-08-29T09:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use earliest twice in one search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198387#M57351</link>
      <description>&lt;P&gt;Hi 0range,&lt;/P&gt;

&lt;P&gt;Surprisingly something like this really works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=_internal (earliest=-2d@d latest=@d sourcetype=scheduler) OR (earliest=-1d@d sourcetype=splunkd) | timechart count by sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;see the picture for the result:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://answers.splunk.com//storage/Capture_11.jpg" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2014 10:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198387#M57351</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-08-29T10:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use earliest twice in one search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198388#M57352</link>
      <description>&lt;P&gt;This does work, but not the way you think.  The earliest and latest work, but the Time Picker is still utilized for the date range.  What this means is if you leave the Time Picker as "All Time", that it will have to search through all time and it is extremely slow, especially compared to if you run the search(es) independently.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 21:48:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198388#M57352</guid>
      <dc:creator>icyfeverr</dc:creator>
      <dc:date>2014-09-25T21:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use earliest twice in one search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198389#M57353</link>
      <description>&lt;P&gt;Your best option to avoid the "searching over a long date range" is to use the &lt;CODE&gt;multisearch&lt;/CODE&gt; search command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch [ search index=_internal earliest=-2d@d latest=@d sourcetype=scheduler ]
              [ search sourcetype=splunkd earliest=-1d@d ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Sep 2014 01:41:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198389#M57353</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-09-26T01:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use earliest twice in one search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198390#M57354</link>
      <description>&lt;P&gt;A Point to add here:&lt;BR /&gt;
Searching each time range separately has the earliest and latest times set correctly, but searching them with an OR in between made it so that it windowed the search by the range of the time picker in the search bar. So if that were set to, say, "All Time," it would search over the entire contents of your sourcetypes just to pull out data between those two date ranges. By the same token, if it were set to "Today", it would cut off entries outside of today and give you an incomplete answer. (And if it were set to something that didn't overlap with either of the date ranges in the search, it would give you an error.)&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2014 05:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198390#M57354</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-26T05:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use earliest twice in one search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198391#M57355</link>
      <description>&lt;P&gt;gkanapathy, I would agree with your response, but it would not work in my circumstance (at least with my current knowledge).  below is the query that I was trying to do as a Subsearch but was unable to get it to work properly because of what myself and MuS explained above and below.&lt;/P&gt;

&lt;P&gt;sourcetype=checks check_number=XXX | eval earliest=strftime(_time-2, "%m/%d/%Y:%H:%M:%S") | eval latest=strftime(_time+2, "%m/%d/%Y:%H:%M:%S") | fields + earliest, latest, sourcetype | format "" "(" "" ")" "OR" ""&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-earliest-twice-in-one-search/m-p/198391#M57355</guid>
      <dc:creator>icyfeverr</dc:creator>
      <dc:date>2020-09-28T17:45:10Z</dc:date>
    </item>
  </channel>
</rss>

