Splunk Enterprise

Why is Splunk email csv column order not being the same as search?

Tim_Accenture
Engager

Recently we discovered that our Splunk sendemail command in combination with the sendcsv option is no longer using the same order for the columns as the search itself. We suspect that that has been broken since we upgraded from 8.x to 9.0.3. We've tried messing around with the width_sort_columns, but this hasn't produced the results we're looking for. Has anyone else experienced the same issues and maybe already found a solution?

Labels (2)
0 Karma

woodcock
Esteemed Legend

Could be this:

width_sort_columnsSyntax: width_sort_columns=<boolean>Description: This is only valid for plain text emails. Specifies whether the columns should be sorted by their width.Default: true

From here:
https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Sendemail

0 Karma

Tim_Accenture
Engager

Thanks for the suggestion. We tried that already and that is not it.

example1.png

still gives the following since version 9.0.x. 

Tim_Accenture_0-1682083612182.png


I'm starting to think this is just a bug. I have been able to confirm this behavior on 2 separate Splunk environments already since we upgraded them from version 8 to 9.

0 Karma

woodcock
Esteemed Legend

Open a support ticket but ALSO go to the documentation page that I listed and go to the bottom and send them feedback and point to this answers post.  They dox team is GREAT and they will get to the bottom of it.

Tim_Accenture
Engager

When using the | sendemail command and setting 'sendcsv=true' in our old situation the attached .csv file would have the same column order of our search. It appears that since upgrading to 9.0.3 from 8.1.x, we can no longer influence the column order in our .csv file.

An example: 

Our search would be 

| ....
| table a b c
| sendemail to=... sendcsv=true

Which in our old situation would keep the column order of our | table command. Now it would be 'b c a' in the .csv file attached in the mail instead of 'a b c'. Whatever order for the table we set in our search no longer influences the .csv file. 

Hope this clarifies it a bit.

0 Karma

woodcock
Esteemed Legend

Be specific here.

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...