<?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: Searching different sources or indexes depending on the timerange of the search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55278#M13496</link>
    <description>&lt;P&gt;Note that stats count in the subsearch just searches to a create a single dummy row so that addinfo can populate it with the info_* fields&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2011 06:49:02 GMT</pubDate>
    <dc:creator>steveyz</dc:creator>
    <dc:date>2011-03-08T06:49:02Z</dc:date>
    <item>
      <title>Searching different sources or indexes depending on the timerange of the search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55276#M13494</link>
      <description>&lt;P&gt;This problem generally occurs when you want to create a dashboard that contains a timerange picker and want to populate the dashboard using summary data, and you have summary data available in multiple granularities.  For example, you may have 5 minute summaries and daily summaries.  So if the user selected a timerange of a month, you'd want to use the daily summaries, but if they selected a timerange of a few hours or a day, you'd want to use the 5minute summaries.  There isn't a straightforward way of doing this.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2011 06:32:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55276#M13494</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2011-03-08T06:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Searching different sources or indexes depending on the timerange of the search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55277#M13495</link>
      <description>&lt;P&gt;The easiest way of doing this involves using addinfo in a subsearch.  Basically, subsearches inherit the timerange of the outer search.  The addinfo command will create several fields that contain the UTC earliest and latest time bounds of the search.  Then you can use the subsearch to expand to different search expressions depending on the range of latest-earliest.&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary [ stats count | addinfo | eval range=info_max_time - info_min_time | eval search=if(range&amp;gt;((86400*7)-3600),"source=daily_summaries","source=5m_summaries") ] | timechart count by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Mar 2011 06:41:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55277#M13495</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2011-03-08T06:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Searching different sources or indexes depending on the timerange of the search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55278#M13496</link>
      <description>&lt;P&gt;Note that stats count in the subsearch just searches to a create a single dummy row so that addinfo can populate it with the info_* fields&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2011 06:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Searching-different-sources-or-indexes-depending-on-the/m-p/55278#M13496</guid>
      <dc:creator>steveyz</dc:creator>
      <dc:date>2011-03-08T06:49:02Z</dc:date>
    </item>
  </channel>
</rss>

