All Apps and Add-ons

Group by a single field

aiah
Explorer

There is this CSV:

user, application, string  
user1, app1, "abcd"  
user2, app2, "222defg"  
user1, app2, "defg"  
user1, app1, "123ks"  
user2, app3, "111abcd"

I would like the result to look like that:

user1, app1, "abcd"  
       app2, "defg"  
       app1, "123ks"  
user2, app3, "111abcd"  
       app2, "222defg" 

I tried this query (and switched to stats list, also):

 ... | table user app string | stats values(app) as app,  values(string) as string  by user

But it does not keep the formation of the rows. values and list returns a collection of object with no connection to their original event.

An extra question - is there a way to mark the user field (bold/show it as header of a group of events, anything else?)

Thanks!

1 Solution

somesoni2
Revered Legend

Just use stats list instead of stats values.

View solution in original post

somesoni2
Revered Legend

Just use stats list instead of stats values.

aiah
Explorer

I thought I tried that already, but now it works. Thanks!

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi aiah,

did you try to add a by user to your search like this:

 ... | stats values(application) as application,  values(string) as string by user

this should do the job.

Regarding the header, maybe this can be done by some css customizing but I cannot tell you that for sure.

hope this helps ...

cheers, MuS

0 Karma

aiah
Explorer

Oops, a bad copy paste. What I described above was when I used 'by user' at the end of the search. The 'columns' are a bunch of values with no connections between the columns.
For some reason I can't edit my original post...

0 Karma
Get Updates on the Splunk Community!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...