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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...