Export query results as CSV files from the Kibana Discover tab.
cd <kibana plugins folder>
git clone git@github.com:jscubida/kibana-discover-csv-export.git
sudo pip install es2csv
npm install @elastic/filesaver
npm install node-cmd
You should remove the contents of Kibana's optimize folder before restarting Kibana.
Navigate to the plugin and modify config.js.
Go to Kibana -> Discover. At the top, you should see an Export CSV button.
A column whose name starts with a _ may or may not be exported properly.