Reporting

Sendemail changing column order

sscandoit
Explorer

Hi,

I am using sendemail command in my search to send results as CSV file. I read the following post which states that prior to version 4.1.4 sendemail orders the results as per column length.

link:Define field order on export

I replaced the generateHTMLResults with the code from sendemail.py from 4.2 version which doesn't sort the columns. However this didn't work.

Can you please tell me how can I display the columns same as given in table command?

Thanks

Suvelee

Tags (2)
0 Karma

aminobtata
New Member

Hi,

I have the same problem :
When I use stats or chart function in splunk my columns displayed in the good order. But if I export the result to CSV sometimes the columns order change.

Please if someone know how to force columns order when using OPTION "-output csv" in search command.
How did you fix it !

Best Regard

0 Karma

aminobtata
New Member

Hi,

I have the same problem :
When I use stats or chart function in splunk my columns displayed in the good order. But if I export the result to CSV sometimes the columns order change.

Please if someone know how to force columns order when using OPTION "-output csv" in search command.
How did you fix it !

Best Regard

0 Karma

fk319
Builder

right before your sendmail command, try using 'fields <field_list>'

0 Karma

sscandoit
Explorer

Thanks for the reply. Tried using fields as you suggested, but that didn't work.

0 Karma
Get Updates on the Splunk Community!

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...