Splunk Search

How to combine multiple search raw strings in a single query

rkishoreqa
Communicator

Hi, 

 

I need to do search with multiple raw strings within a single query.  When I search these strings separately, I am able to get the results.  But when I combine these it is not giving the results and ending with 'No results found'. 

The below three queries are working fine.

  • sourcetype="States*"  *Karnataka*
  • sourcetype="States*"  *Tamil Nadu*
  • sourcetype="States*"  *Mumbai*

When I execute the below query I am getting 'No results found' comment. 

  • sourcetype="States*"  *Karnataka*  *Tamil Nadu*  *Mumbai*

Can anyone through some light on this, thanks in advance.

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

richgalloway
SplunkTrust
SplunkTrust

SPL inserts an implicit AND between each search term.  To search for optional terms, insert an explicit OR.

sourcetype="States*" ("*Karnataka*" OR "*Tamil Nadu*" OR "*Mumbai*")

 

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

SPL inserts an implicit AND between each search term.  To search for optional terms, insert an explicit OR.

sourcetype="States*" ("*Karnataka*" OR "*Tamil Nadu*" OR "*Mumbai*")

 

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

saravanan90
Contributor

Please use "OR" inbetween the searches..

sourcetype="States*"  (*Karnataka*  OR  *Tamil Nadu* OR  *Mumbai*)

Get Updates on the Splunk Community!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...