Getting Data In

What decides the order of the fields output in CSV files from Splunk, and is there a way to control the order?

xiyangyang
Path Finder

We output .csv file from splunk.

When we test on a test machine, the order of CSV file fields is "Action", "Returncode", "_time","host","DB_User","OS_User","Userhost","Terminal".

However, when we run this in production, "Action" and "Returncode" become last, so the order changes to "_time","host","DB_User","OS_User","Userhost","Terminal", "Action", "Returncode".

We simply want to know what decides the field order of a .csv file which is output from Splunk? Is there anyway we can control the order?

0 Karma

jluo_splunk
Splunk Employee
Splunk Employee

Hi xiyangyang,

It turns out field ordering only happens on the search UI. Command line search does not do this ordering. If you'd like to control the order when you export to CSV, you can do a work around with an approach similar to the one used here : https://answers.splunk.com/answers/60017/search-jobs-export-changes-order-of-columns-unexpectedly.ht...

0 Karma
Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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