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
Revered Legend

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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...