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!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...