Splunk Search

Search Condition in index

chuck_life09
Path Finder

Hi,

I want to search the index with the eventtype which has "service" or "window" in the value

index=sdsf | search eventtype="*service*" or "*window*"  | stats count by eventtype

this is not working. can you help if the OR will work or not.

Labels (1)
Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

How is it not working? No results or wrong results?

index=sdsf | search eventtype="*service*" or eventtype="*window*"  | stats count by eventtype

View solution in original post

gcusello
Esteemed Legend

HI @chuck_life09,

try to put the search conditions as in the main search as possible:

index=sdsf (eventtype="*service*" OR eventtype="*window*")  
| stats count by eventtype

Ciao.

Giuseppe

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

How is it not working? No results or wrong results?

index=sdsf | search eventtype="*service*" or eventtype="*window*"  | stats count by eventtype

chuck_life09
Path Finder

Hi,

@ITWhisperer 

Thank you this worked, it dint show me results that were pertaining to "service" or "window". now it is showing me the events which has either of those 2 words.

0 Karma
Get Updates on the Splunk Community!

Splunk Lantern | Spotlight on Security: Adoption Motions, War Stories, and More

Splunk Lantern is a customer success center that provides advice from Splunk experts on valuable data ...

Splunk Cloud | Empowering Splunk Administrators with Admin Config Service (ACS)

Greetings, Splunk Cloud Admins and Splunk enthusiasts! The Admin Configuration Service (ACS) team is excited ...

Tech Talk | One Log to Rule Them All

One log to rule them all: how you can centralize your troubleshooting with Splunk logs We know how important ...