# get the deployment id and name.
# ecctl deployment list | jq -r '.deployments[] | .id, .name'
short_deploymnent_id=$(echo $1| cut -b -6)
credentials=$(find . | grep --color=never $short_deploymnent_id | xargs grep -v username | sed -e s/\,/\:/ -e s/,true//)
endpoint=$(ecctl deployment show $1 | jq -r '.resources.elasticsearch[0].info.metadata | (.endpoint + ":" + (.ports.https|tostring))')
url="https://$endpoint"
cat data.json | http --quiet -a $credentials POST $url/_bulk
- assuming that you have downloaded credentials already on the current directory.
[nami:kibana_cloud]$ ls -1
credentials-5d388b-2020-Dec-14--11_02_47.csv
credentials-803051-2020-Dec-14--10_51_20.csv
data.json
push.data.sh
[nami:kibana_cloud]$
[nami:kibana_cloud]$ ecctl deployment list | jq -r '.deployments[] | .id, .name'
803051d2e7bf4b6c97752621f9183e82
771
5d388b101c784eb983a30c73d846720c
791
[nami:kibana_cloud]$ sh push.data.sh 803051d2e7bf4b6c97752621f9183e82
[nami:kibana_cloud]$