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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...