Reporting

transpose with a group by

mschellhouse
Path Finder

my data is currently setup as follows:

Group / Flag / Count
G1 / No / 5
G1 / Yes / 10
G1 / Total / 15
G2 / No / 7
G2 / Yes / 19
G1 / Total / 26
...

I am trying to "transpose" the data to this:
Group / Yes / No / Total
G1 / 5 / 10 / 15
G2 / 7 / 19 / 26
...

0 Karma
1 Solution

jluo_splunk
Splunk Employee
Splunk Employee

So it sounds like you have something like this..

| stats count by group, flag
| appendpipe [stats sum(count) by group]

Instead, try this..

| chart count by group, flag
| addtotals row=t col=f

View solution in original post

jluo_splunk
Splunk Employee
Splunk Employee

So it sounds like you have something like this..

| stats count by group, flag
| appendpipe [stats sum(count) by group]

Instead, try this..

| chart count by group, flag
| addtotals row=t col=f

jluo_splunk
Splunk Employee
Splunk Employee

Can you post the search string you have to get your current table of data?

0 Karma

mschellhouse
Path Finder

Happy to answer questions about it but can't post the actual query. Doing a stats command by Group and Flag to get the count. To get the Total, I am using appendpipe.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...