Documentations and Articles

Articles

Setup

Repositories

Tips & configuration

Interaction with Elasticsearch via CURL

Abstract

This note content the basic, popular command of elasticsearch and case it can use

Note

All commands will work if you need bypass HTTPS. But if it not accepted, you need to provide the crt and key with compulsory

Get the list snapshot

# Get list snapshot
curl --insecure -X GET "https://<es-username>:<es-password>@<es-domain>:<es-port>/_cat/snapshots/<repository>"
 
# List first 50 snapshot, add `comma` to easily create the removing strings
 
curl --insecure -X GET "https://<es-username>:<es-password>@<es-domain>:<es-port>/_cat/snapshots/azure" | awk '{print $1}' | head -n 50 | xargs -I{} echo -n "{}," | rev | cut -c2- | rev | xargs

Delete specify snapshot

curl -X DELETE --insecure "https://<es-username>:<es-password>@<es-domain>:<es-port>/_snapshot/<repository>/<name-snapshot>