Getting Data In

How to create a report about each index and the sourcetypes it contains?

giy4
Engager

I need to create a report that shows each index on my system and the relevant data about sourcetypes within the index. I know I can use |metadata type=sourcetypes index=myindex and get the information for a specific index, but I want to basically pull all of my indexes and run that command for each of the indexes I have.

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Ok, so here you go. This uses the rest command, and the metadata command. It will increase in execution time as the number of indexes increases.

|rest /services/data/indexes count=0 | dedup title | fields title | map  [|metadata type=sourcetypes index="$title$" | eval type="$title$"] maxsearches=1000 | stats values(totalCount) by sourcetype type | rename type as index
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...