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.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...