<?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 do write a search to list all indexes associated with a sourcetype? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255769#M76588</link>
    <description>&lt;P&gt;Just tried tstats - way faster. Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2015 12:17:00 GMT</pubDate>
    <dc:creator>hkj2332</dc:creator>
    <dc:date>2015-10-02T12:17:00Z</dc:date>
    <item>
      <title>How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255763#M76582</link>
      <description>&lt;P&gt;I have no trouble listing all the sourcetypes associated with an index, but I need to go the other way - What are all the indexes for a given sourcetype. The search I started with for this is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* OR index=_* sourcetype= SourceTypeName | dedup index | table index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, this is very slow (not a surprise), and, more a concern, not returning all the indexes that use that sourcetype. &lt;/P&gt;

&lt;P&gt;Is there a faster search I can use to do this and not miss associated indices? &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 19:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255763#M76582</guid>
      <dc:creator>hkj2332</dc:creator>
      <dc:date>2015-10-01T19:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255764#M76583</link>
      <description>&lt;P&gt;Hi hkl2332,&lt;/P&gt;

&lt;P&gt;much faster to use &lt;CODE&gt;metasearch&lt;/CODE&gt; as it search only in the metadata of the specified indexes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metasearch index=* sourcetype=* | stats count by index, sourcetype | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See the docs &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Metasearch"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/Metasearch&lt;/A&gt; for more details.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 19:59:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255764#M76583</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-10-01T19:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255765#M76584</link>
      <description>&lt;P&gt;That'll get me a list of all the sourcetypes - any idea how to also get the indices that use that sourcetype in the resulting table?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 20:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255765#M76584</guid>
      <dc:creator>hkj2332</dc:creator>
      <dc:date>2015-10-01T20:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255766#M76585</link>
      <description>&lt;P&gt;Oh sorry my bad &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; mess up &lt;CODE&gt;metadata&lt;/CODE&gt; and &lt;CODE&gt;metasearch&lt;/CODE&gt; so see my updated answer &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 20:24:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255766#M76585</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-10-01T20:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255767#M76586</link>
      <description>&lt;P&gt;Oh, of course... Thanks!!! I've run this search before, but for some reason I was totally forgetting I can order by EITHER column. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 20:28:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255767#M76586</guid>
      <dc:creator>hkj2332</dc:creator>
      <dc:date>2015-10-01T20:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255768#M76587</link>
      <description>&lt;P&gt;Another faster method availabe 6.1 onward Splunk versions is tstats. Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* sourcetype=* by index, sourcetype | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I've seen it run much faster then metasearch.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 22:46:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255768#M76587</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-10-01T22:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255769#M76588</link>
      <description>&lt;P&gt;Just tried tstats - way faster. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2015 12:17:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255769#M76588</guid>
      <dc:creator>hkj2332</dc:creator>
      <dc:date>2015-10-02T12:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255770#M76589</link>
      <description>&lt;P&gt;@MuS - Is there anyway to get this working in dependent of time?&lt;/P&gt;

&lt;P&gt;I want to list ALL  index and the sourcetype.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2017 23:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255770#M76589</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-25T23:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do write a search to list all indexes associated with a sourcetype?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255771#M76590</link>
      <description>&lt;P&gt;@jagadeeshm you can run a &lt;CODE&gt;tstats&lt;/CODE&gt; search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count where index=* by sourcetype, index, _time | timechart sum(count) AS count by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jan 2017 23:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-write-a-search-to-list-all-indexes-associated-with-a/m-p/255771#M76590</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-01-26T23:06:51Z</dc:date>
    </item>
  </channel>
</rss>

