Splunk Search

How come the output of our tstats command is not getting written to a CSV?

Arpit_S
Path Finder

Hi,

I am trying to create a lookup that has the names of all the indexes and the timestamp of the oldest event in that index.

I am running the below search for this:

|tstats earliest(_time) as oldestEvent by index | outputlookup abcd.csv

I ran this search for almost 3 hours, and even then, the search wasn't complete. Though, when hovering over the progress bar, I was able to see that the search had scanned 100% of the events, but there were no results in the CSV.

Can someone help me with this.

Regards,
Arpit

Tags (2)
0 Karma

p_gurav
Champion

Try this:

| metasearch index=* | stats earliest(_time) as earliest_time by index

0 Karma

Arpit_S
Path Finder

This search is also taking forever to run.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Arpit_S

Have you tried rest command??

| rest /services/data/indexes 

Can you please confirm it's working for you?

| rest /services/data/indexes | table title minTime | rename minTime as oldestEvent, title as index | outputlookup abcd.csv

Thanks

0 Karma

Arpit_S
Path Finder

@kamlesh_vaghela I am able to run "| rest /services/data/indexes " but there is no value under minTime field for me.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@Arpit_S

Did you get minTime field blank for all the indexes??

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