Splunk Search

Searching for multiple strings

jxjackso
Explorer

I'm trying to collect all the log info for one website into one query. The site uses two starting url's /dmanager and /frkcurrent. I'm trying to figure out a query that will give me both the dmanager and frkcurrent records

I tried: sourcetype=access_combined frkcurrent *dmanager* but I don't get any results. I know I'm doing something wrong, but I'm not sure what. I looked through the search manual, but didn't see anything that stood out as an obvious answer.

Thanks

0 Karma
1 Solution

ftk
Motivator

You need to use OR logic in your query as such:

sourcetype=access_combined (frkcurrent OR dmanager)

Check out the this part of the documentation for a more in depth coverage of the search language.

View solution in original post

jxjackso
Explorer

Gah, I tied or, but didn't capitalize it.

0 Karma

ftk
Motivator

You need to use OR logic in your query as such:

sourcetype=access_combined (frkcurrent OR dmanager)

Check out the this part of the documentation for a more in depth coverage of the search language.

stanwin
Contributor

If I have large number of nested OR conditions..

e.g. there are 40 error codes that I need to search through in logs to show only relevant events in timechart..

what would be better option?

  multiple OR conditions  (1 OR 2  OR 3 ... OR 40 )
 configure a  lookup

In terms of tidiness or adding new codes, lookup is better definetely.

However there will be no increase in the error code list ever..

So in terms of performance is the OR Clause or lookup preferred approach?

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

@stanwin i'd suggest asking a new question and deleting this comment - this question has already been answered and might not get very much attention

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...