Splunk Search

Use of == with or operator

arabhi
New Member

I want to compare some data with fields and then rename the data matched with fields. Since we have large set of data and comparing of all those data with fields it makes query bulky. Can anyone give efficient code for this??

Example: stats count(eval(fieldname=="some data" OR fieldname=="some data")) as XYZ count(eval(fieldname=="some data" OR fieldname=="some data" OR fieldname=="some data" fieldname=="some data" fieldname=="some data"fieldname=="some data"fieldname=="some data"fieldname=="some data"fieldname=="some data")) as ABC..............by fieldname


Tags (1)
0 Karma
1 Solution

PavelP
Motivator

Hello @arabhi,

 stats count(eval(fieldname IN ("value1", "value2", "value3"))) AS XYZ

View solution in original post

0 Karma

PavelP
Motivator

Hello @arabhi,

 stats count(eval(fieldname IN ("value1", "value2", "value3"))) AS XYZ
0 Karma

to4kawa
Ultra Champion

make CSV for lookup and use lookup command
and aggregate the output

0 Karma
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...