Splunk Search

How to add a variable from a lookup table to filter results?

Gggflyer
New Member

I am trying to do a tstats command to get the last logged time a server has sent logs.  My server list i want in the table is in a lookup csv.

The command i am using is 

Tstats latest(_time) as lastseen where (index=windows) by host | convert ctime(lastseen)

The "where" clause i would like to be something like "where the server name is on the lookup table"

 

Basically trying to filter the output of the query to just any server i have in the lookup table

Labels (2)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use a subsearch.

| tstats latest(_time) as lastseen where (index=windows) [ | inputlookup hostlist.csv | fields host | format ] by host 
| convert ctime(lastseen)
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...