Splunk Search

how to compare multiple fields

Tridi123
New Member

i have key words like project,plan ,lease
now if any file name if these key word hits i need to find which keywords have hitted.

if my file mane is Project_plan gamil.doc then keywords hitted are

project and plan.
Can anyone help what should be the Splunk query for this require ment

Tags (2)
0 Karma

yannK
Splunk Employee
Splunk Employee

After the search, use a regex extraction like rex or an eval function like match to check the presence of the keyword in the source field. And make correction for any case case sensitive matching.
Then you can have a field that will contain or not the matching.

example :


mysearch | rex field=source "(?(?i)(project))" | table _time found_project source _raw

OR

mysearch | eval source_lowercase=lower(source) | eval found_project=match(source_lowercase,project) | table _time found_project source _raw

0 Karma

Tridi123
New Member

suppose my filed is like contain both plan and project and i want my found_project column as project,plan what should i do
and the second query is not working as macth returns boolean only can u help once againg for this isssue??

0 Karma
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!

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 ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...