Splunk Search

How to list result data

gijoesplunk
New Member

Hi, i have a result data like:
host dest_ip src_ip
FW1 192.168.10.1 172.16.20.1
FW1 192.168.10.2 172.16.20.2
FW1 192.168.10.3 172.16.20.3
FW2 192.168.10.4 172.16.20.4
FW2 192.168.10.5 172.16.20.5
FW3 192.168.10.6 172.16.20.6

i want to list or get result data like:
FW1
FW2
FW3

Please advice the syntax to obtain datat like above.
I have tried using: "myquery..... | stats values(host) " but the result was like this:
FW1
FW1
FW1
FW2
FW2
FW3

0 Karma

gijoesplunk
New Member

thank's for the all answer.
But now i would like to ask something different, if the "host" contains time&date like this one:
host

Oct 13 16:59:03 FW1
Oct 13 16:59:03 FW1
Oct 13 16:59:04 FW1
Oct 13 16:59:04 FW2
Oct 13 16:59:05 FW2
Oct 13 16:59:06 FW3

how can i get info only:
FW1
FW2
FW3

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Hosts should be in separate fields from the timestamps. Then the same answers as above apply. If they are not in separate fields, you should separate them before doing anything else. Use rex or the field extractor to separate host names from timestamps.

---
If this reply helps you, Karma would be appreciated.
0 Karma

sundareshr
Legend

Try stats count by host | fields host *OR* dedup host | table host

0 Karma

gijoesplunk
New Member

thank's for all the answer,
but now i would like to ask a bit different, if the host contain date and time like:
Oct 13 16:59:03 FW1
Oct 13 16:59:03 FW1
Oct 13 16:59:04 FW1
Oct 13 16:59:04 FW2
Oct 13 16:59:05 FW2
Oct 13 16:59:06 FW3

How can i get result only like this:
FW1
FW2
FW3

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try stats list(host).

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...

[Puzzles] Solve, Learn, Repeat: Tiling

This puzzle (first published here) is based on finding groups of tessellated tiles (inspired by floor tiles I ...

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...