Splunk Search

How to chart values only where 2 or more values are returned?

ulikabbq
Path Finder

I am using a chart function as follows:

| chart count, values(status) by user

and I only want to get back the results that have 2 or more statuses. I have tried some eval commands but I haven't gotten anything to work properly.

Tags (2)
1 Solution

aweitzman
Motivator

Try this:

| chart count, values(status) as allStatuses by user | where mvcount(allStatuses) > 1

View solution in original post

aweitzman
Motivator

Try this:

| chart count, values(status) as allStatuses by user | where mvcount(allStatuses) > 1

yannK
Splunk Employee
Splunk Employee

you can use the distinct count too

| chart count, values(status) as allStatuses, dc(status) AS distinct_statuses by user | where distinct_statuses > 1 | fields - distinct_statuses

Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...