Prerequisites
Install the jq command and in2csv (included in csvkit, converts JSON output to CSV) beforehand. A Python environment is also required.
sudo yum -y install jq
pip install csvkit
Get Elasticsearch Results in CSV Format
curl https://vpc-xxxxxxx-xxxxxx.ap-northeast-1.es.amazonaws.com/xxxxxxx/_search?pretty | jq [.hits.hits[]._source] | in2csv -f json