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
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...