Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_count in Kibana 4.3.1 returns 404 Not Found #5791

Closed
taraslayshchuk opened this issue Dec 31, 2015 · 1 comment
Closed

_count in Kibana 4.3.1 returns 404 Not Found #5791

taraslayshchuk opened this issue Dec 31, 2015 · 1 comment

Comments

@taraslayshchuk
Copy link

Hi!

I am using Kibana 4.3.1 and Elasticsearch 2.1.1.
When I try to count documents like its descibed it Count API Docs I get {"statusCode":404,"error":"Not Found"}

$ curl -XPOST 'localhost/elasticsearch/logstash-2015.11.11/log/_count' -d '{ "query": { "term": { "cluster": "c1" }}}' --header "kbn-version:4.3.1"
{"statusCode":404,"error":"Not Found"}
$ curl -XPOST 'localhost/elasticsearch/logstash-2015.11.11/_count' -d '{ "query": { "term": { "cluster": "c1" }}}' --header "kbn-version:4.3.1"
{"statusCode":404,"error":"Not Found"}

XGET returns just nothing

$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/log/_count' -d '{ "query": { "term": { "cluster": "c1" }}}' --header "kbn-version:4.3.1"
^C

But search returns proper values

$ curl -XPOST 'localhost/elasticsearch/logstash-2015.11.11/_search' -d '{ "query": { "term": { "cluster": "c1" }}}' --header "kbn-version:4.3.1"
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":16490,"max_score":2.7392588,"hits":[{"_index":"logstash-2015.11.11","_type":"log","_id":"AVH3Gz3a5TjNLP8D_WhF","_score":2.7392588,"_source":{.....}}}

But only without docs type

$ curl -XPOST 'localhost/elasticsearch/logstash-2015.11.11/log/_search' -d '{ "query": { "term": { "cluster": "c1" }}}' --header "kbn-version:4.3.1"
{"statusCode":404,"error":"Not Found"}

And if I use string query syntax it works good

$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/log/_count?q=cluster:c1' --header "kbn-version:4.3.1"
{"count":16490,"_shards":{"total":5,"successful":5,"failed":0}}

And it simply works in Kibana 4.1.1 in any way.

$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/log/_count?q=cluster:c1' 
{"count":16490,"_shards":{"total":5,"successful":5,"failed":0}}
$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/_count?q=cluster:c1' 
{"count":16490,"_shards":{"total":5,"successful":5,"failed":0}}
$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/log/_count' -d '{ "query": { "term": { "cluster": "c1" }}}' 
{"count":16490,"_shards":{"total":5,"successful":5,"failed":0}}
$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/_count' -d '{ "query": { "term": { "cluster": "c1" }}}' 
{"count":16490,"_shards":{"total":5,"successful":5,"failed":0}}
$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/log/_search' -d '{ "query": { "term": { "cluster": "c1" }}}' 
{"took":10,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":16490,"max_score":2.7392588,"hits":[{"_index":"logstash-2015.11.11","_type":"log","_id":"AVH3Gz3a5TjNLP8D_WhF","_score":2.7392588,"_source":{...}}}
$ curl -XGET 'localhost/elasticsearch/logstash-2015.11.11/_search' -d '{ "query": { "term": { "cluster": "c1" }}}' 
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":16490,"max_score":2.7392588,"hits":[{"_index":"logstash-2015.11.11","_type":"log","_id":"AVH3Gz3a5TjNLP8D_WhF","_score":2.7392588,"_source":{....}

So what changed in 4.3.1? And where documentation for this? Maybe it's just bug and should be fixed?

@spalger
Copy link
Contributor

spalger commented Dec 31, 2015

The kibana server implements a filtered proxy to elasticsearch but it is only exposed for Kibana to make specific requests and doesn't expose the entire elasticsearch API. It is also undocumented and I don't recommend depending on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants