Splunk Search

list time when the logs are indexed by Splunk

flzftw
Explorer

Hey guys,

I'm a splunk newbie and I'm trying to list all the time a specific index tries to access the log file. So far I did achieve this :
index=test | eval indexed_time=strftime(_indextime, "%+") | stats max(indexed_time) by index

As far as I know It only shows the last time the test index accessed its log file.

Is it possible to list all of them ? If yes, how can I do it for a specific day ?

Thank you very much

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

You have the process reversed. Indexes do not access log files; log files are placed into indexes. To find all of the index times, don't use stats max.

index=test | eval indexed_time=strftime(_indextime, "%+") | table _time indexed_time source
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

You have the process reversed. Indexes do not access log files; log files are placed into indexes. To find all of the index times, don't use stats max.

index=test | eval indexed_time=strftime(_indextime, "%+") | table _time indexed_time source
---
If this reply helps you, Karma would be appreciated.

flzftw
Explorer

I see, now I understand better the process. Thank you very much !

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...