<?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 search for two source types, each in different time ranges without using join or a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141224#M39106</link>
    <description>&lt;P&gt;Just for clarification (I misunderstood the answer until I double checked what happens), the searches will only restrict to explicitly given time ranges (via earliest and latest) and otherwise use the widest possible time range. For example, doing this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch [search a] [search b earliest=-7d@d latest=-6d@d]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with a global timespan of "Today" will not restrict search a to "Today". Instead, search a will run from -7d@d up to now (search b will use the explicit time range given). So to use multisearch correctly, you should probably always define earliest and latest per search.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2016 09:56:33 GMT</pubDate>
    <dc:creator>jeffland</dc:creator>
    <dc:date>2016-12-01T09:56:33Z</dc:date>
    <item>
      <title>How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141215#M39097</link>
      <description>&lt;P&gt;In my below query,  I want to load sourcetypeA for last 13 weeks, however I want to restrict sourcetypeB for last 7 days without using earliest&lt;/P&gt;

&lt;P&gt;The below trick now()-_time is not working for me. I'm getting " Comparator '&amp;lt;' has an invalid term on the left hand side. " error&lt;/P&gt;

&lt;PRE&gt;index=my_index (sourcetype=sourcetypeA  AND FILE_ID=100002 ) OR (sourcetype=sourcetypeB AND ((now()-_time)&amp;lt;691220) )
&lt;/PRE&gt;

&lt;P&gt;I don't want to filter after the base query, as the data in sourcetypeB is very huge and is drastically hindering the performance of the query&lt;/P&gt;

&lt;P&gt;Using the second query (sourcetypeB) as sub query or Join is not an option currently for me&lt;/P&gt;

&lt;P&gt;Is there a way I can achieve this?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Pradeep&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141215#M39097</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-09-25T17:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141216#M39098</link>
      <description>&lt;P&gt;Hi @gpradeepkumarreddy&lt;/P&gt;

&lt;P&gt;I know you said you want a solution without earliest, but I thought this post might be helpful with your desired result. Would this work for you?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://answers.splunk.com/answers/153336/is-it-possible-to-use-earliest-twice-in-one-search.html"&gt;http://answers.splunk.com/answers/153336/is-it-possible-to-use-earliest-twice-in-one-search.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141216#M39098</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-09-25T17:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141217#M39099</link>
      <description>&lt;P&gt;Thanks much Pat. I never thought it would work and didn't give it a try.  Looks like its working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;You can convert this to answer, I'll accept it.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141217#M39099</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2014-09-25T17:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141218#M39100</link>
      <description>&lt;P&gt;No problem Pradeep! I saw that post the other day and bookmarked it since I thought it would be helpful for other people. It came in handy much sooner than expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141218#M39100</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-09-25T17:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141219#M39101</link>
      <description>&lt;P&gt;This is a situation where &lt;CODE&gt;multisearch&lt;/CODE&gt; will be useful:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch [ search sourcetype=sourceA FileID=XYZABC ] [ search sourcetype=sourceB earliest=-7d ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Sep 2014 01:39:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141219#M39101</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-09-26T01:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141220#M39102</link>
      <description>&lt;P&gt;And it's useful because of the multisearches will search only over the specified time ranges. If you use &lt;CODE&gt;earliest&lt;/CODE&gt;/&lt;CODE&gt;latest&lt;/CODE&gt; in a single base search more than once, you will have to scan the span of the widest time range of all the clauses. This may or may not make a big difference depending on your searches and data distribution.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2014 01:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141220#M39102</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-09-26T01:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141221#M39103</link>
      <description>&lt;P&gt;Just 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:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141221#M39103</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-09-26T05:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141222#M39104</link>
      <description>&lt;P&gt;This is why I recommend &lt;CODE&gt;multisearch&lt;/CODE&gt; as a better solution.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2014 06:51:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141222#M39104</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2014-09-26T06:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141223#M39105</link>
      <description>&lt;P&gt;Awesome, thanks for this answer and explanation @gkanapathy. I'll definitely recommend this search command to folks with similar use cases from now on. &lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2014 16:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141223#M39105</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2014-09-29T16:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for two source types, each in different time ranges without using join or a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141224#M39106</link>
      <description>&lt;P&gt;Just for clarification (I misunderstood the answer until I double checked what happens), the searches will only restrict to explicitly given time ranges (via earliest and latest) and otherwise use the widest possible time range. For example, doing this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| multisearch [search a] [search b earliest=-7d@d latest=-6d@d]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with a global timespan of "Today" will not restrict search a to "Today". Instead, search a will run from -7d@d up to now (search b will use the explicit time range given). So to use multisearch correctly, you should probably always define earliest and latest per search.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 09:56:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-two-source-types-each-in-different-time-ranges/m-p/141224#M39106</guid>
      <dc:creator>jeffland</dc:creator>
      <dc:date>2016-12-01T09:56:33Z</dc:date>
    </item>
  </channel>
</rss>

