Splunk Search

printing the output in a formated way

abhayneilam
Contributor

I have a file which contains :

Col1  Col2       Col3
abc    23        good
                  bad
xyz    34        this
                 that
mno    45        great

My output should be :

col1    col2    col3 
abc     23     good,bad
xyz     34     this,that
mno     45     great

Please help !!

Thanks
Abhay

0 Karma

sideview
SplunkTrust
SplunkTrust

The difference is that your col3 values are multivalued fields, and you want them to be a single field where each value is separated by commas.

Try this on the end of your search:

eval col3=mvjoin(col3,",")

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 ...