Splunk Search

How to filter my search to only list values for a field that contain more than one host?

varma365
New Member

Here is a simple question. The following is my search:

index="atg" sessionId="*mob" host="*" | stats values(host) as hosts,values(source) as sources by sessionId 

Now I want to list out the sessionId values which contain more than one host or one source. How can I filter the results?

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Add a dc(host) to the search, then filter off that key.

 index="atg" sessionId="*mob" host="*"
 | stats values(host) as hosts, dc(host) as hostcount, values(source) as sources by sessionId 
 | where hostcount > 1
0 Karma

shivarpith
Path Finder

how do we write this query in case on SPlunk Enterprise Security

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...