Splunk Search

how to display data with multiple column and row?

jasklee
Engager

I need to create a table which will display

workweek as rows

and subarea as column, meanwhile the data inside will display the passing percentage for each subarea for every workweek.

i tried

*|stats count(eval(status="Failed")) AS fail,count(eval(status="Passed")) AS pass by workweek|eval passPercentage=if(pass+fail== 0, "-",round(pass/(pass+fail)*100,2))|fields workweek,passPercentage

This will only calculate for overall passPercentage for each workweek, but i want it to be done with each subarea of each workweek...

my sample output will be like this

              subArea1 subArea2 subArea3...

workweek1 12 32 88

workweek2 96 45 12

workweek3 23 78 43

workweek4 37 79 98

Tags (4)
0 Karma

lguinn2
Legend

Try this

yoursearchhere
| stats count(eval(status="Failed")) as fail, count(eval(status="Passed")) as pass by workweek subArea
| eval passPercentage=if(pass+fail== 0, "-",round(pass/(pass+fail)*100,2))
| xyseries workweek subArea passPercentage
0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...