curl -XGET 127.0.0.1:9200/
curl -XGET 127.0.0.1:9200/_cat
curl 127.0.0.1:9200/_cat/health?v
curl 127.0.0.1:9200/_cat/nodes?v
curl 127.0.0.1:9200/_cat/indices?v
curl 127.0.0.1:9200/_cat/shards?v
curl 127.0.0.1:9200/_cat/templates?v
curl 127.0.0.1:9200/_template/logstash?pretty=true
search command pattern
curl 127.0.0.1:9200/[index_pattern]/[type_name]/_search
curl 127.0.0.1:9200/logstash*/_search?pretty=true
curl 127.0.0.1:9200/logstash*/doc,user/_search?pretty=true
curl 127.0.0.1:9200/logstash*/doc,user/_search?q=status:200
curl 127.0.0.1:9200/logstash*/_search?pretty=true --header "Content-Type: application/json" \
-d '{
"query" : {
"term" : { "status" : "200" }
}
}'
This example show metric aggregation with cadinality. (Uniq Count)
curl 127.0.0.1:9200/logstash*/_search?pretty=true --header "Content-Type: application/json" \
-d '{
"aggs" : {
"type_count" : {
"cardinality" : {
"field" : "status.keyword"
}
}
}
}'
This example show bucket aggregation using term.
curl 127.0.0.1:9200/logstash*/_search?pretty=true --header "Content-Type: application/json" \
-d '{
"aggs" : {
"logstash*" : {
"terms" : {
"field" : "status.keyword",
"size" : 10
}
}
}
}'