Splunk Search

Search to find indexes with events and display index size, total events , earliest and latest events per index

mlevsh
Builder

Hi,

what would be the best way to find indexes with events and display its size, total events , earliest and latest events per index
on index cluster?

index      size      total_events     earliest event       latest event
alfa1        12Gb     1,000,000       2/2/2017 10:09    2/21/2019 9:01PM
alfa2       1Gb        90,000         1/1/2015  09:34   2/21/2109 9:02PM

Thank you in advance!

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Use dbinspect (and a stats command after dbinspect) to get those information.

https://docs.splunk.com/Documentation/Splunk/7.2.4/SearchReference/Dbinspect

View solution in original post

0 Karma

somesoni2
Revered Legend

Use dbinspect (and a stats command after dbinspect) to get those information.

https://docs.splunk.com/Documentation/Splunk/7.2.4/SearchReference/Dbinspect

0 Karma

andhika_pratama
Explorer
  1. make a shell script to monitor directory size for each apps
  2. create monitor in inputs.conf with specified index & sourcetype and link it to shell script for each apps
  3. Make a field from selected pattern, name it index_size
  4. use querry: index=existing_index_0 OR index=existing_index_n |stats latest(index_size) as Size, count as total_events, earliest(_time) as FirstAppearance, latest(_time) as LastAppearance | fieldformat FirstAppearance=strftime(FirstAppearance,"%x %X") | fieldformat LastAppearance=strftime(LastAppearance,"%x %X")

MuS
SplunkTrust
SplunkTrust

Hi mlevsh,

Don't re-invent the wheel, take a look at the Monitoring Console inside Splunk Settings >> Monitoring Console it contains dashboards that will show exactly what you want. Read more about the monitoring console here https://docs.splunk.com/Documentation/Splunk/latest/DMC/IndexingIndexesandvolumes

Hope this helps ...

cheers, MuS

0 Karma

mlevsh
Builder

@MuS , unfortunately it won't help. dashboard needs to be a little different in order to see info about indexes with events only and no events

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...