<?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: Get extracted fields count per index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/611841#M212713</link>
    <description>&lt;P&gt;Can also be accomplished over time by:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;index=summary sourcetype=stash source IN (Summary_Error_*) 
| fields + * 
| bin _time span=1d 
| eval search_name=search_name+"#"+_time
| stats mode(*) AS * by  search_name
| transpose 1000 header_field=search_name column_name=fieldName 
| eval type=if(match(fieldName,"(_raw|_time|date_.*|eventtype|tag.*|index|sourcetype|host|info_.*|punct|time*.?pos|search_name|search|search_now|splunk_server.*|linecount)"),"internal","custom")
| stats count(*) AS * BY type
| transpose 1000  column_name=search_name header_field=type
| rename "row 1" AS fieldCount
| search search_name!=fieldName
| rex field=search_name "(?&amp;lt;search_name&amp;gt;[^#]+)#(?&amp;lt;_time&amp;gt;.*)"
| stats max(*) as * BY _time search_name&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 03 Sep 2022 20:28:42 GMT</pubDate>
    <dc:creator>BDein</dc:creator>
    <dc:date>2022-09-03T20:28:42Z</dc:date>
    <item>
      <title>How to get extracted fields count per index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240118#M71365</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Trying to get the count of extracted fields per index. I am using the following search for this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;index=*|fieldsummary|stats count&lt;BR /&gt;This gives me the entire list of all fields in all index.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Also "stats count by index" doesnt work as fieldsummary doesnt have index value. How can we get the field count per index.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2022 21:29:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240118#M71365</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2022-09-04T21:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get extracted fields count per index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240119#M71366</link>
      <description>&lt;P&gt;This one has me stumped in terms of how to achieve this with a search. Bear in mind though even if this is possible that the count of extracted fields will vary depending on the app context, the user that you run the search as, and could change constantly depending on the time ranges that you are using. &lt;/P&gt;

&lt;P&gt;Is there any chance you could share your use case? There may be another way to achieve what ever it is you are trying to do!&lt;/P&gt;

&lt;P&gt;If you're not fussed to do it in a single search then you could run the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=* |   stats values(*) as * by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then process the results elsewhere (eg excel, shell script, etc)&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2016 13:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240119#M71366</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2016-05-09T13:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get extracted fields count per index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240120#M71367</link>
      <description>&lt;P&gt;I am planning to get the extract fields count per index for past 7 days duration and then compare it with the fields count for today.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 06:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240120#M71367</guid>
      <dc:creator>harshal_chakran</dc:creator>
      <dc:date>2016-05-16T06:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Get extracted fields count per index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240121#M71368</link>
      <description>&lt;P&gt;Hi, you just like to know how many times a field has a value? (for a certain index)&lt;BR /&gt;
I like simple, so how about this?&lt;/P&gt;

&lt;P&gt;index= sourcetype= field_name=* | stats count(field_name)&lt;/P&gt;

&lt;P&gt;By adding the wildcard for your field, you only search on events that have a value for your field.&lt;BR /&gt;
If the load on this index is too heavy, or you like to do this regularly, you could also consider writing the results to a summary index. ( | collect index= sourcetype=)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:41:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240121#M71368</guid>
      <dc:creator>renems</dc:creator>
      <dc:date>2020-09-29T09:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Get extracted fields count per index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240122#M71369</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* | chart limit=0 count(*) as * by index | untable index field value | stats count as fieldcount by index
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2016 16:24:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/240122#M71369</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-05-16T16:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get extracted fields count per index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/611838#M212711</link>
      <description>&lt;P&gt;How about this one:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=summary sourcetype=stash source IN (Summary_Error_*) 
| fields + * 
| stats mode(*) AS #* by search_name 
| transpose header_field=search_name column_name=fieldName 
| eval type=if(match(fieldName,"#(_raw|date_.*|eventtype|tag.*|index|sourcetype|host|info_.*|punct|time*.?pos|search_name|search|search_now|splunk_server.*|linecount)"),"internal","custom") 
| stats count(*) AS * BY type 
| transpose column_name=search_name header_field=type 
| rename "row 1" AS fieldCount 
| search search_name!=fieldName&lt;/LI-CODE&gt;&lt;P&gt;It was used for summary index by might as well be used other ways.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2022 19:25:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/611838#M212711</guid>
      <dc:creator>BDein</dc:creator>
      <dc:date>2022-09-03T19:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get extracted fields count per index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/611841#M212713</link>
      <description>&lt;P&gt;Can also be accomplished over time by:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;index=summary sourcetype=stash source IN (Summary_Error_*) 
| fields + * 
| bin _time span=1d 
| eval search_name=search_name+"#"+_time
| stats mode(*) AS * by  search_name
| transpose 1000 header_field=search_name column_name=fieldName 
| eval type=if(match(fieldName,"(_raw|_time|date_.*|eventtype|tag.*|index|sourcetype|host|info_.*|punct|time*.?pos|search_name|search|search_now|splunk_server.*|linecount)"),"internal","custom")
| stats count(*) AS * BY type
| transpose 1000  column_name=search_name header_field=type
| rename "row 1" AS fieldCount
| search search_name!=fieldName
| rex field=search_name "(?&amp;lt;search_name&amp;gt;[^#]+)#(?&amp;lt;_time&amp;gt;.*)"
| stats max(*) as * BY _time search_name&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 03 Sep 2022 20:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-extracted-fields-count-per-index/m-p/611841#M212713</guid>
      <dc:creator>BDein</dc:creator>
      <dc:date>2022-09-03T20:28:42Z</dc:date>
    </item>
  </channel>
</rss>

