Splunk Search

Get the recent event date from a .csv using inputlookup at the same time append a wildcard into the host.

ephraimjoseph
New Member

Currently, this is my SPL query and it just displays different results

this is my hostname_list.csv

host
hostname_a*
hostname_b*
hostname_c*



| inputlookup hostname_list.csv
| fields host
| join type=inner host [search index=unix | stats latest(_time) as latest_time, latest(source) as source, latest(_raw) as event by host | convert ctime(latest_time) as latest_time] | table host, latest_time, source, event

and it displays like this one:

hostlatest_timesourceevent
hostname_a*   
hostname_b*   
hostname_c*   

I assume that the wildcard "*" is acting like a literal string.

I'm expecting results like this.

hostlatest_timesourceevent
hostname_a12testtesttest
hostname_a23testtesttest
hostname_c123testtesttest



please help thanks!

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

index=unix [|inputlookup hostname_list.csv]
| stats latest(_time) as latest_time, latest(source) as source, latest(_raw) as event by host | convert ctime(latest_time) as latest_time | table host, latest_time, source, event
0 Karma
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...