Is there a way to force the columns order in output?
karthikdivi opened this issue · 3 comments
karthikdivi commented
es2csv is not honouring the order of specified columns. For example if it write -f b a in the output csv i see a column first.
taraslayshchuk commented
This question was already asked. So let me explain why it is sorted.
When you are using -f you will ask elasticsearch for specific fields, but they can be missing in ES.
Thats way es2csv don't care about order of asked fields (ES already returns fields in wrong order). So best solution for me was just sort them in alphabetic. Any way you can move columns in your favorite editor (MS Office, LibreOffice).
taraslayshchuk commented
Hello, @karthikdivi, please check 2.4.2 release, this should fix columns order.
karthikdivi commented
Awesome @taraslayshchuk
Thanks again for the great tool.