Splunk Search

Multiple grouping ofdata over chart

ujwalagangakoth
New Member

alt textI have to group defects based on severity and again based on release.the chart should contain multiple grouping first by severity then by release.I have two envs prod and pre prod .I have to group preprod and prod based on severity i.e for sev1 we need preprod and prod grouping same goes for sev2 and sev3 ,then these sev1,sev2,sev3 will be again grouped by release. so in chart , i need release wise grouping and in each release ,each severit contains prod and pre prod
index="index" sourcetype="defects" (STATE="Closed" OR STATE="Retest Complete") DETECTED_IN_RELEASE="" SEVERITY="" ENVIRONMENT=D000002 OR ENVIRONMENT=D000007 OR ENVIRONMENT=Prod OR ENVIRONMENT=Production|sort DETECTED_IN_RELEASE |stats count(eval(ENVIRONMENT= "D000002" OR ENVIRONMENT="D000007")) as PPROD_IND count(eval(ENVIRONMENT="Prod" OR ENVIRONMENT="Production")) as PROD_IND by DETECTED_IN_RELEASE SEVERITY | stats sum(PPROD_IND) as TOT_PPROD sum(PROD_IND) as TOT_PROD by DETECTED_IN_RELEASE SEVERITY
| eval DRE%=round(TOT_PPROD/(TOT_PPROD+TOT_PROD)*100,1)
|rename DETECTED_IN_RELEASE as Release
| chart sum(TOT_PPROD) as PPROD sum(TOT_PROD) as PROD over Release by SEVERITY

This is the query i am using but I am not able to dispaly DIE% as overlay field and also I need further classiifcation of Release i.e consider there are releases ab,cd,de,ef chart should display the fields in this format in three level grouping

PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod (env grouping)
Sev 1 Sev2 Sev3 Sev 1 Sev2 Sev3 Sev 1 Sev2 Sev3 (severity grouping)
ab cd ef (release grouping)

Tags (2)
0 Karma

mayurr98
Super Champion

hey if you give us sample input event and output you want to achieve then it would be good.
Meanwhile try this

index=your_index | stats count  as no_of_defects by  prod_environment severity release

let me know if this helps you!

0 Karma

ujwalagangakoth
New Member

index="index" sourcetype="defects" (STATE="Closed" OR STATE="Retest Complete") DETECTED_IN_RELEASE="" SEVERITY="" ENVIRONMENT=D000002 OR ENVIRONMENT=D000007 OR ENVIRONMENT=Prod OR ENVIRONMENT=Production|sort DETECTED_IN_RELEASE |stats count(eval(ENVIRONMENT= "D000002" OR ENVIRONMENT="D000007")) as PPROD_IND count(eval(ENVIRONMENT="Prod" OR ENVIRONMENT="Production")) as PROD_IND by DETECTED_IN_RELEASE SEVERITY | stats sum(PPROD_IND) as TOT_PPROD sum(PROD_IND) as TOT_PROD by DETECTED_IN_RELEASE SEVERITY
| eval DRE%=round(TOT_PPROD/(TOT_PPROD+TOT_PROD)*100,1)
|rename DETECTED_IN_RELEASE as Release
| chart sum(TOT_PPROD) as PPROD sum(TOT_PROD) as PROD over Release by SEVERITY

This is the query i am using but I am not able to dispaly DIE% as overlay field and also I need further classiifcation of Release i.e consider there are releases ab,cd,de,ef chart should display the fields in this format

PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod PProd,Prod
Sev 1 Sev2 Sev3 Sev 1 Sev2 Sev3 Sev 1 Sev2 Sev3
ab cd ef

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...