Splunk Search

How to change the output format of search results?

gadeanup1
Engager

Using my splunk query, I am getting the output as follows (X and Y are headers)-

X         Y
-----------
1        A
         B
         C
2        A
         B
         C
3        A
         B
         C
4        A
         B
         C

But I need the output in the below format -

X         Y
-----------
1         A
1         B
1         C
2         A
2         B
2         C
3         A
3         B
3         C
4         A
4         B
4         C

I tried using stats, list, and other formatting commands but it didn't work for me.
Can I get any help? Thanks in advance....

0 Karma
1 Solution

sundareshr
Legend

I assume your query looks like this (you may have list, instead of values)

base search | stats values(y) as y by x

change this to...

base search | stats values(y) as y by x | mvexpand y

View solution in original post

sundareshr
Legend

I assume your query looks like this (you may have list, instead of values)

base search | stats values(y) as y by x

change this to...

base search | stats values(y) as y by x | mvexpand y

inventsekar
SplunkTrust
SplunkTrust

Good learnings, Sundaresh Sir.

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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