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!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...