Splunk Search

Why are events containing multiple results when exported as csv getting merged in single row one after the other?

kgiri253
Explorer

As we can see below the two events contain multiple results. But when I try to export it as csv all these events get merged into a single row one after the other.

Currently merged output in for one event --->  result1 result2 result3 result4

But I want the data to be exported in csv as it is (i.e all the results in different rows)

 

kgiri253_1-1662637769086.png

 

 

Labels (1)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

Oh, I took shortcut with Splunk's autoformating.  Just remove leading space after newline.

| foreach *
    [ eval <<FIELD>> = mvjoin(<<FIELD>>, "
") ]

(Autoformating is a great assistant but...) 

View solution in original post

Tags (1)

yuanliu
SplunkTrust
SplunkTrust

If line break is the only thing that matters, you can use this crude method

| foreach *
    [ eval <<FIELD>> = mvjoin(<<FIELD>>, "
    ") ]

BTW, your subject line says "imported" as opposed to "exported".

kgiri253
Explorer

@yuanliuthanks for your help, it worked but now only the first result is correctly aligned, rest of the results can be seen with extra space. Please refer to the image below.

Thanks for correcting the import -> export error

kgiri253_0-1662716781933.png

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Oh, I took shortcut with Splunk's autoformating.  Just remove leading space after newline.

| foreach *
    [ eval <<FIELD>> = mvjoin(<<FIELD>>, "
") ]

(Autoformating is a great assistant but...) 

Tags (1)
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...