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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...