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 Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...