Splunk Search

How to create a search with several events from one host with different condition?

bosseres
Contributor

Hello, everyone

I need help from community.

I want to make search that will find two+ events from same host, for example user=David action=success AND user=Mike, but this events must be only on one host.
Thank you in advance.

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @bosseres,

sorry but your requrest isn't so clear:

do you want to find the users that have logins to more hosts or hosts with logins from more users?

Anyway, the approach is the same, the change is in the use of fields:

multiple user logins for the same host

your_search
| stats dc(users) AS dc_users values(users) As users BY host
| where dc_users>1

multiple hosts for the same user

your_search
| stats dc(host) AS dc_host values(host) As host BY user
| where dc_host>1

In general I hint to follow the Splunk Search Tutorial (https://docs.splunk.com/Documentation/Splunk/8.2.6/SearchTutorial/WelcometotheSearchTutorial) to understand how to create a search in Splunk.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

Index This | When is October more than just the tenth month?

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

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...