Splunk Search

Search with output_mode=csv ends up reordering the table command output.

paragcisco
Explorer

I am doing something like this:
[ignore some syntax issues]

curl ... https://..../search/jobs/export -d 'search=search index=xyz ... | table Fld1 Fld2' -d output_mode=csv

Expected output (as given to table command) is:
Fld1,Fl2
123,abc

Actual output is
Fld2,Fld1
abc ,123

Any idea why it is getting re-ordered and how can I get it in the format I want?

Tags (3)

ShaneNewman
Motivator

I ran into a similar issue... Ended up using .... | table field1 field2 | outputcsv foo.csv and it corrected the problem.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...