Splunk Search

How to create a list of all indexes with source, host, and sourcetype with last seen field?

mpham07
Path Finder

Hello all, I'm currently working on figuring how to create a list of as mentioned in the title with the last seen field.
This field will show when the host was last seen in our logs.

It's kind of similar to the solution below but will only list last seen time for all hosts.

Thank you in advance for your assistance.

https://answers.splunk.com/answers/332987/how-to-search-the-list-of-devices-that-have-sent-l.html

0 Karma
1 Solution

jaime_ramirez
Communicator

Like this?

| tstats latest(_time) as latest where (index=* earliest=-1mon@mon  latest=-0h@h) by index host source sourcetype
| convert ctime(latest)

View solution in original post

jaime_ramirez
Communicator

Like this?

| tstats latest(_time) as latest where (index=* earliest=-1mon@mon  latest=-0h@h) by index host source sourcetype
| convert ctime(latest)

mpham07
Path Finder

Thank you so much Jaime! Worked out perfectly and extremely fast search.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...