<?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 Can you help me craft a search that returns all indexes with their associated retention times? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445024#M77469</link>
    <description>&lt;P&gt;Technically, this is two questions in one with the goal of solving a single problem:  I need an SPL query that returns &lt;EM&gt;ALL&lt;/EM&gt; the indexes I can search and the associated retention time for each.  Here is how far I've gotten:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/data/indexes | eval yr = floor(frozenTimePeriodInSecs/86400/365)| eval dy = (frozenTimePeriodInSecs/86400) % 365 | eval ret = yr . " years, " . dy . " days" | stats list(splunk_server) list(frozenTimePeriodInSecs) list(ret) by title
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The query above is very very close, but it only returns a subset of the indexes — technically, it only returns 32 index names to me, and I have many more than that.  (Note- starting with "rest /services/admin/indexes ... " makes no difference either.&lt;/P&gt;

&lt;P&gt;My second query is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventcount summarize=false index=* index=_* | dedup index | fields index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will return all 250+ index names, but I can't seem to find anyway to get back to the retention period.&lt;/P&gt;

&lt;P&gt;So my two questions are:&lt;BR /&gt;
1) Why is the &lt;CODE&gt;rest&lt;/CODE&gt; command only pulling a subset (&amp;lt;15%) of all indexes that are returned by the event count query?&lt;BR /&gt;
2) How can I get a single query that gets to my goal to have a single SPL query that shows all 250+ indexes and their associated retention setting?&lt;/P&gt;</description>
    <pubDate>Thu, 06 Sep 2018 13:49:16 GMT</pubDate>
    <dc:creator>awmorris</dc:creator>
    <dc:date>2018-09-06T13:49:16Z</dc:date>
    <item>
      <title>Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445024#M77469</link>
      <description>&lt;P&gt;Technically, this is two questions in one with the goal of solving a single problem:  I need an SPL query that returns &lt;EM&gt;ALL&lt;/EM&gt; the indexes I can search and the associated retention time for each.  Here is how far I've gotten:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/data/indexes | eval yr = floor(frozenTimePeriodInSecs/86400/365)| eval dy = (frozenTimePeriodInSecs/86400) % 365 | eval ret = yr . " years, " . dy . " days" | stats list(splunk_server) list(frozenTimePeriodInSecs) list(ret) by title
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The query above is very very close, but it only returns a subset of the indexes — technically, it only returns 32 index names to me, and I have many more than that.  (Note- starting with "rest /services/admin/indexes ... " makes no difference either.&lt;/P&gt;

&lt;P&gt;My second query is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventcount summarize=false index=* index=_* | dedup index | fields index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will return all 250+ index names, but I can't seem to find anyway to get back to the retention period.&lt;/P&gt;

&lt;P&gt;So my two questions are:&lt;BR /&gt;
1) Why is the &lt;CODE&gt;rest&lt;/CODE&gt; command only pulling a subset (&amp;lt;15%) of all indexes that are returned by the event count query?&lt;BR /&gt;
2) How can I get a single query that gets to my goal to have a single SPL query that shows all 250+ indexes and their associated retention setting?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 13:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445024#M77469</guid>
      <dc:creator>awmorris</dc:creator>
      <dc:date>2018-09-06T13:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445025#M77470</link>
      <description>&lt;P&gt;| rest /services/data/indexes - &lt;BR /&gt;
 technically, it only returns 32 index names to me and i have many more than that ?!?!? &lt;BR /&gt;
may i know why it returns only 32?!?!  on my splunk, it returns more than 2000 indexes.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 14:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445025#M77470</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2018-09-06T14:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445026#M77471</link>
      <description>&lt;P&gt;tried your top search and it works nice &lt;BR /&gt;
can you double check?&lt;BR /&gt;
or try this and use your &lt;CODE&gt;evals&lt;/CODE&gt;&lt;BR /&gt;
    | rest /services/data/indexes-extended&lt;BR /&gt;
    | table title frozenTimePeriodInSecs&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 14:53:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445026#M77471</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-09-06T14:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445027#M77472</link>
      <description>&lt;P&gt;@awmorris,&lt;/P&gt;

&lt;P&gt;By default, maximum number of entries returned is 30. Please refer to this documentation  : &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Maximum number of entries to return. Set value to 0 to get all available entries.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/RESTREF/RESTprolog#Pagination_and_filtering_parameters"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/RESTREF/RESTprolog#Pagination_and_filtering_parameters&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rest /services/data/indexes count=0&lt;/CODE&gt; to override the default vlaue&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 14:58:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445027#M77472</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-06T14:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445028#M77473</link>
      <description>&lt;P&gt;this is the exact scenario i am facing.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:01:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445028#M77473</guid>
      <dc:creator>awmorris</dc:creator>
      <dc:date>2018-09-06T17:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445029#M77474</link>
      <description>&lt;P&gt;Good call out on the count limit.... but i still only get 32.  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:02:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445029#M77474</guid>
      <dc:creator>awmorris</dc:creator>
      <dc:date>2018-09-06T17:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445030#M77475</link>
      <description>&lt;P&gt;I reran it again.... even this simple query ONLY returns 32 indexes:&lt;/P&gt;

&lt;P&gt;"| rest /services/data/indexes-extended | table title frozenTimePeriodInSecs"&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445030#M77475</guid>
      <dc:creator>awmorris</dc:creator>
      <dc:date>2018-09-06T17:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445031#M77476</link>
      <description>&lt;P&gt;Updated info:  If I use an account with Administrator privileges, I get the full list- not just the 32- so it must be a permission thing somehow.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Sep 2018 18:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445031#M77476</guid>
      <dc:creator>awmorris</dc:creator>
      <dc:date>2018-09-06T18:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445032#M77477</link>
      <description>&lt;P&gt;@awmorris,&lt;/P&gt;

&lt;P&gt;Also check the permissions as mentioned in the doc &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.2/RESTREF/RESTintrospect#data.2Findexes"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.2/RESTREF/RESTintrospect#data.2Findexes&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**Authorization and authentication**
By default, all users can list all indexes. However, if the indexes_list_all capability is enabled in authorize.conf, access to all indexes is limited to only those roles with this capability.

To enable indexes_list_all capability restrictions on the data/indexes endpoint, create a [capability::indexes_list_all] stanza in authorize.conf. Specify indexes_list_all=enabled for any role permitted to list all indexes from this endpoint. 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Sep 2018 02:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445032#M77477</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-07T02:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445033#M77478</link>
      <description>&lt;P&gt;Dashboard to interactively review index parameters and their values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form theme="dark"&amp;gt;
  &amp;lt;label&amp;gt;Indexes&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="title_pattern" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Index Pattern&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="title_list" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Index List (,separated)&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="title" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Index&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;title&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;title&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| rest /services/data/indexes 
| search title="*$title_pattern$*" title IN($title_list$)
| dedup title
| table title 
| sort title&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-1m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="parameter_pattern" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Parameter Pattern&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="parameter_list" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Parameter List  (,separated)&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="parameter" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Parameter&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;parameter&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;parameter&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| rest /services/data/indexes 
| search title=$title$ title="*$title_pattern$*" title IN($title_list$) 
| transpose 0 column_name="parameter" header_field="title" 
| search parameter="*$parameter_pattern$*" parameter IN($parameter_list$) NOT parameter="parameter"
| table parameter&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;-1m&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="value_pattern" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Value Pattern&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="value" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Value (exact)&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Index Parameters&amp;lt;/title&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| rest /services/data/indexes 
| search title=$title$ title="*$title_pattern$*" title IN($title_list$) 
| transpose 0 column_name="parameter" header_field="title" 
| search parameter="*$parameter_pattern$*" parameter IN($parameter_list$) parameter="$parameter$" 
| untable parameter title value 
| table title parameter value 
| eval {parameter}=value 
| search value="*$value_pattern$*" value="$value$" 
| table title parameter value 
| chart limit=1000000 values(value) as value by parameter title&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-30m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;15&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Nov 2019 03:41:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445033#M77478</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2019-11-25T03:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me craft a search that returns all indexes with their associated retention times?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445034#M77479</link>
      <description>&lt;P&gt;There is a search on the &lt;CODE&gt;Monitoring Console&lt;/CODE&gt; that gives you most of this but it is missing a piece: how to see what your actual effective retention is based on the buckets that are freezing.  You can see that part with this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" AND sourcetype="splunkd" AND bucketmover AND freeze 
| rex "[\/\\\](?&amp;lt;indexname&amp;gt;[^\/\\\]*)[\/\\\][^\/\\\]*db[\/\\\]db_(?&amp;lt;newestTime&amp;gt;\d+)_(?&amp;lt;oldestTime&amp;gt;\d+)_\d+" 
| rex "db_(?&amp;lt;newestTime&amp;gt;\d+)_(?&amp;lt;oldestTime&amp;gt;\d+)_\d+.*?[\/\\\](?&amp;lt;indexname&amp;gt;[^\/\\\]*)[\/\\\][^\/\\\]*db" 
| sort 0 indexname - oldestTime
| dedup indexname 
| eval retention = _time - oldestTime 
| fieldformat retention = tostring(retention, "duration") 
| table _time indexname retention
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Nov 2019 14:57:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-you-help-me-craft-a-search-that-returns-all-indexes-with/m-p/445034#M77479</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-25T14:57:34Z</dc:date>
    </item>
  </channel>
</rss>

