Shubham Mishra
Shubham Mishra

Reputation: 1153

Exclude some indexes from elasticsearch query

I am using _all as index pattern and this causes kibana-4 to search every possible index. As kibana-4 has its own .kibana index, it tries to search for the required data in .kibana index and since it doesn't parse the data there it throws some parsing exceptions. So Is there any way by which I can configure kibana-4 to exclude .kibana for searching..

Upvotes: 8

Views: 6413

Answers (3)

Farhan
Farhan

Reputation: 1505

This worked for me. In query you can exclude some them like this:

"filter": {
    "bool": {
        "must_not": {
            "term": {
                "_index": "<the_index_you_want_to_exclude>"
            }
        }
    }
}

Upvotes: 0

slawek
slawek

Reputation: 2779

You could create your own alias similar to _all and use it in kibana. Or you could just exclude .kibana index from _all index alias.

Upvotes: 0

Lee H
Lee H

Reputation: 5177

I was able to successfully ignore the .kibana index by using the following request:

curl 'localhost:9200/*,-*kibana/_search?q=*:*'

This will search all indices (the first "*") excluding all indices that end with "kibana".

Upvotes: 8

Related Questions