Splunk Search

how do I count values based on many values using a multiselect filter

Talking_Master
Explorer

Hi I am trying to count values based on values if they equal a range of values. Is that possible? 

| search fieldName=$Token $
| stats count(eval(fieldName)) AS Label by FieldName
| table FieldName

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @Talking_Master,

one information: you used "fieldName" and "FieldName": are they two different fields or it's a mistyping?

if it's a mistyping, you can simplify your search:

| search fieldName=$Token $
| stats count AS Label by FieldName
| table FieldName

if they are two different fields, you don't need to use the eval in the stats count command.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...