Splunk Search

Stats Around Events and Sources

andrewkenth
Communicator

Is there an internal search I can run that will return the number of events loaded to date and number of files (sources) loaded to date?

I can obviously run searches similar to what I have below and accelerate them but I was wondering if there was a better way to do it.

 ... | stats count first(_time) by source | stats count(source)

or

.... | stats count first(_time) by source
Tags (3)
0 Karma
1 Solution

linu1988
Champion

Hello,
You may get that from the metadata command.

|metadata type=sources

will provide you all the sources from where you got the events

|metadata type=sources|stats sum(totalCount) as "Total Events"

Provides you the total number of events till date

Thanks

View solution in original post

0 Karma

linu1988
Champion

Hello,
You may get that from the metadata command.

|metadata type=sources

will provide you all the sources from where you got the events

|metadata type=sources|stats sum(totalCount) as "Total Events"

Provides you the total number of events till date

Thanks

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Another option for total events counts across all indexes:

| eventcount summarize=false index=* |stats sum(count) as TotalEvents

For total no of files loaded
|metadata type=sources | stats count

combined
| eventcount summarize=false index=* |stats sum(count) as TotalEvents | appendcols [|metadata type=sources | stats count as TotalFiles]

0 Karma
Get Updates on the Splunk Community!

Observability | How to Think About Instrumentation Overhead (White Paper)

Novice observability practitioners are often overly obsessed with performance. They might approach ...

Cloud Platform | Get Resiliency in the Cloud Event (Register Now!)

IDC Report: Enterprises Gain Higher Efficiency and Resiliency With Migration to Cloud  Today many enterprises ...

The Great Resilience Quest: 10th Leaderboard Update

The tenth leaderboard update (11.23-12.05) for The Great Resilience Quest is out >> As our brave ...