Skip to content

Elasticsearch Debugging

Jason Ish edited this page Jun 16, 2020 · 6 revisions

Get a template by name

curl http://localhost:9200/_template/logstash

List all templates

curl http://localhost:9200/_cat/templates

List indices

curl http://localhost:9200/_cat/indices
curl http://localhost:9200/_cat/indices/logstash*

Mapping for an index

curl http://localhost:9200/logstash-2020.05.14/_mapping

Fixing Shard Errors

For the error:

elasticsearch_1  | "stacktrace": ["org.elasticsearch.action.search.SearchPhaseExecutionException: Partial shards failure (1 shards unavailable)",

the following command appeared to fix the issue:

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'
{
    "transient" : {
        "cluster.routing.allocation.enable" : "all"
    }
}
'