curl http://localhost:9200/
curl http://localhost:9200/_aliases
Get all indices in a cluster (pretty):
curl http://localhost:9200/_aliases?pretty=true
curl http://localhost:9200/_cat/indices?h=health,status,index,id,pri,rep,docs.count,docs.deleted,store.size,creation.date.string&v=
Resource: https://stackoverflow.com/questions/17426521/list-all-indexes-on-elasticsearch-server
curl http://localhost:9200/_cat/count?v
curl http://localhost:9200/index/_count
This is where you can get answers to questions like “what do I have access to?”
curl http://localhost:9200/_security/role
Resource: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html
curl http://localhost:9200/_security/user
Resource: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html
curl http://localhost:9200/_security/api_key
curl http://localhost:9200/*/_mapping
curl http://localhost:9200/index_name/_mapping
Resource: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html
curl http://localhost:9200/index_name/_search?pretty=true
Resource: https://stackoverflow.com/questions/14565888/how-can-i-view-the-contents-of-an-elasticsearch-index
curl -XPOST "http://localhost:9200/index_name/_search?pretty=true" \
-H 'Content-Type: application/json' -d '
{
"size": 100
}'
This particular example will look for documents with ip addresses in the body of the log field:
curl -XPOST "http://localhost:9200/index_name/_search?pretty=true" \
-H 'Content-Type: application/json' -d '
{
"query": {
"regexp": {
"log": "/[0-9]|[0-9][0-9]|[0-9]/"
}
}
}'
Resource: https://stackoverflow.com/questions/25313051/elasticsearch-and-regex-queries