Splunk Search

Host Check-in to Sourcetype

itsmevic
Communicator

Hi,

We have a sourcetype type called "WinHostMon" and many hosts report into it.   Does anyone have any SPL laying around that would allow me to query the last time a host checked in with that particular Sourcetype? 
Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this:

| tstats max(_indextime) AS time_event_was_indexed max(_time) AS time_event_happened WHERE index="*" AND sourcetype="WinHostMon" BY host
| sort 1 - time_event_was_indexed 
0 Karma

dindu
Contributor

Hi,

Try the below SPL.Modify based on your need.

|tstats count where  sourcetype=WinHostMon by host,_time,sourcetype
|table host,sourcetype,_time
|sort - _time  
|head 1
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 ...