Create a snapshot

Create a snapshot in a registered repository

curl -X PUT http://localhost:9200/_snapshot/<repo>/<snapshot>

tool
elasticsearch19 commands
tags
elasticsearch

More elasticsearch commands

  • curl -s 'http://localhost:9200/<index>/_ilm/explain' | jq '.indices | to_entries[] | {index:.key, phase:.value.phase, action:.value.action}'

    Show the current ILM phase and action for an index

  • curl -s http://es:9200/_cluster/health?pretty

    Show cluster status (green, yellow or red) with shard counts

  • curl -s 'http://es:9200/_cat/indices?v&s=store.size:desc'

    Show all indices sorted by size, largest first

  • curl -X DELETE http://es:9200/logs-2024.01.01

    Delete one index, there is no undo

  • curl -X GET 'http://es:9200/logs-*/_search?pretty' -H 'Content-Type: application/json' -d '{"query":{"match":{"level":"error"}},"size":5}'

    Find 5 log entries with level "error" (no sorting, so not always the newest)

all 19 elasticsearch commands