Getting Data In

query for searching passive hosts

kteng2024
Path Finder

Can someone please explain me what does the following query will do step by step ?

  type=hosts | sort -recentTime | convert ctime(recentTime) as Latest_Time

thank you

0 Karma

richgalloway
SplunkTrust
SplunkTrust

That query is not valid. I believe the correct version would be

| metadata type=hosts | sort -recentTime | convert ctime(recentTime) as Latest_Time

which retrieves a list of host names from the default indexes, sorts them from most-recently used to least-recently used, then converts the recentTime field from epoch format into text and renames it to Latest_Time.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...