<?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 can I get the search work with multiple indexes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553594#M157176</link>
    <description>&lt;P&gt;It works by changing "by _time,index" to "by index,_time"!&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;</description>
    <pubDate>Fri, 28 May 2021 21:51:13 GMT</pubDate>
    <dc:creator>vl951f</dc:creator>
    <dc:date>2021-05-28T21:51:13Z</dc:date>
    <item>
      <title>How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553421#M157132</link>
      <description>&lt;P&gt;I have the search to get max number of hours without events for feeds.&lt;/P&gt;&lt;P&gt;It works just for one index. It wouldn't work with more than one index. How can I get it work for multiple indexes?&lt;/P&gt;&lt;P&gt;index=feed1 OR index=feed2&lt;BR /&gt;| bucket _time span=1h&lt;BR /&gt;| stats count as event_count by _time, index&lt;BR /&gt;| search event_count!=0&lt;BR /&gt;| delta _time as mydelta&lt;BR /&gt;| eval number_of_zeros=floor(mydelta/3600)-1&lt;BR /&gt;| stats max(number_of_zeros) by index&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 23:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553421#M157132</guid>
      <dc:creator>vl951f</dc:creator>
      <dc:date>2021-05-27T23:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553425#M157135</link>
      <description>&lt;P&gt;"It wouldn't work" is not a problem description.&amp;nbsp; Your query works for me (using my own index names).&amp;nbsp; Well, it produces output, anyway.&amp;nbsp; I can't say if it truly works since you don't say what it's supposed to do.&lt;/P&gt;&lt;P&gt;What results do you get and what results do you expect?&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 00:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553425#M157135</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-05-28T00:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553445#M157141</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233940"&gt;@vl951f&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;are you sure that the field name is always the same in all indexes (upper and lowercase)?&lt;/P&gt;&lt;P&gt;If not, you have to add a command to your search:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=feed1 OR index=feed2
| eval event_count=coalesce(event_count1, event_count2)
| bucket _time span=1h
| stats count as event_count by _time, index
| search event_count!=0
| delta _time as mydelta
| eval number_of_zeros=floor(mydelta/3600)-1
| stats max(number_of_zeros) by index&lt;/LI-CODE&gt;&lt;P&gt;Please, when you insert code in your comments, please use the Insert/Edit code sample Button (&amp;lt;/&amp;gt;).&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 06:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553445#M157141</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-05-28T06:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553576#M157169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to get the max number of hours with no events for the indexes.&lt;/P&gt;&lt;P&gt;It works when I did it for one index.&lt;/P&gt;&lt;P&gt;index=feed1&lt;BR /&gt;Result:&lt;BR /&gt;index max(number_of_zeros)&lt;BR /&gt;feed1 6&lt;/P&gt;&lt;P&gt;index=feed2&lt;BR /&gt;Result:&lt;BR /&gt;index max(number_of_zeros)&lt;BR /&gt;feed2 4&lt;/P&gt;&lt;P&gt;But got wrong results for more than one index:&lt;/P&gt;&lt;P&gt;index=feed1 OR index=feed2&lt;BR /&gt;Result:&lt;BR /&gt;index max(number_of_zeros)&lt;BR /&gt;feed1 1&lt;BR /&gt;feed2 2&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 19:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553576#M157169</guid>
      <dc:creator>vl951f</dc:creator>
      <dc:date>2021-05-28T19:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553580#M157170</link>
      <description>&lt;P&gt;I'm just counting the number of event for each hour for the index.&lt;/P&gt;&lt;P&gt;| bucket _time span=1h&lt;BR /&gt;| stats count as event_count by _time, index&lt;/P&gt;&lt;P&gt;It didn't use any other field names.&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 19:10:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553580#M157170</guid>
      <dc:creator>vl951f</dc:creator>
      <dc:date>2021-05-28T19:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553592#M157175</link>
      <description>&lt;P&gt;When you are calculating delta there are different events which it's use based on one index or several. For that reason the delta between those events are different. You could get better result if you change in stats by to index, _time instead of _time, index (but it's not works 100% of time still, if will be broken when index changes from one to another). I afraid that you need to reformulate this query to get correct answer for several indexes.&lt;/P&gt;&lt;P&gt;You can check the events by commenting out the last stats statement and try to figure out the correct answer.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 21:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553592#M157175</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2021-05-28T21:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get the search work with multiple indexes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553594#M157176</link>
      <description>&lt;P&gt;It works by changing "by _time,index" to "by index,_time"!&lt;/P&gt;&lt;P&gt;Thank you so much&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 21:51:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-get-the-search-work-with-multiple-indexes/m-p/553594#M157176</guid>
      <dc:creator>vl951f</dc:creator>
      <dc:date>2021-05-28T21:51:13Z</dc:date>
    </item>
  </channel>
</rss>

