Query with rest api via cli for elastic search

A short technical note summarizing the basic approach and applicable steps for querying with rest api via cli for elastic search.

Can be updated over time

The following commands are given with curl for cli. The same requests can be made from postman or directly from the browser. If you do not want the json result data to appear pretty, you should remove the &pretty=true section at the end.

index meta file

curl -X GET http://es1:9200/index-name

search

curl -X GET http://es1:9200/index-name/_search?q=*:*&size=10

all indexes

curl -X GET http://es2:9200/_aliases?pretty=true