Splunk Search

How to group results by name

marina_rovira
Contributor

Hello all,

I have a search with these results
compl count(Number)
0 1
p1-compliant 5
p1-no-compliant 3
p2-compliant 4
p3-compliant 5
p3-no-compliant 5

and the graphic visualization is like this one:
alt text

However, I would like to present it group by priorities as
P0
p1 -> compliant and non-complaint
p2 -> compliant and non-complaint
p3 -> compliant and non-complaint
p4 -> compliant and non-complaint

in a graphic like this, were there are two bars for one value, as seying the compliant and not compliant bars together for the same prority:
alt text

Do you know if it's possible to group it by prorities?

Thank you in advance!

0 Karma
1 Solution

javiergn
SplunkTrust
SplunkTrust

Assuming the following CSV:

compl,Number
0,1
p1-compliant,5
p1-no-compliant,3
p2-compliant,4
p3-compliant,5
p3-no-compliant,5

This is what I've done:

| inputcsv mycsv.csv
| rex field=compl "^(?<priority>p\d)\-(?<compliance>.+)$"
| where isnotnull(compliance)
| chart values(Number) as count over priority by compliance

And the output:

alt text

View solution in original post

fdi01
Motivator

try like :

...| chart count(Number) as count over priority by compliance

javiergn
SplunkTrust
SplunkTrust

Assuming the following CSV:

compl,Number
0,1
p1-compliant,5
p1-no-compliant,3
p2-compliant,4
p3-compliant,5
p3-no-compliant,5

This is what I've done:

| inputcsv mycsv.csv
| rex field=compl "^(?<priority>p\d)\-(?<compliance>.+)$"
| where isnotnull(compliance)
| chart values(Number) as count over priority by compliance

And the output:

alt text

Get Updates on the Splunk Community!

.conf24 | Registration Open!

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

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...