Splunk Search

index data

Siddharthnegi
Contributor

Hello , How can I know the start time and the latest time  coming of data of all index .
meaning that when was the first time data came in that index and when is the latest time data have came in that index.

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Do you really want to know the times in the entire index?  If so, tstats is usually the way to go.

| tstats min(_time) as start max(_time) as end where index=myindex
| fieldformat start = strftime(start, "%F %T")
| fieldformat end = strftime(end, "%F %T")

Something like that.

Siddharthnegi
Contributor

Thank You for your reply , but I want this information for all indexes  at once with their respective names is that possible?

0 Karma

yuanliu
SplunkTrust
SplunkTrust

This is where you need to be extra diligent in problem statement.  Yes, it is doable but volunteers are not mind readers.

| tstats min(_time) as start max(_time) as end where index=* by index
| fieldformat start = strftime(start, "%F %T")
| fieldformat end = strftime(end, "%F %T")

 

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, ...