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!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...