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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

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

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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