Can't connect to Kibana API with CURL. I keep receiving {"statusCode":404,"error":"Not Found","message":"Not Found"}

I'm trying to connect to Kibana API via CURL:

curl -X "GET" "http://<my-elastic-host>:5601/status" --user <my-username> --noproxy '*' -H 'kbn-xsrf: true'

But all I receive is:

{"statusCode":404,"error":"Not Found","message":"Not Found"}

Even if I give wrong username, the error is the same. Elastic API works perfectly fine on port 9200. The elastic stack version I use is 7.15. My guess is, that API can be totally blocked or wrongly configured, but I can not find anything about it in Kibana API documentation. I've seen in other forum discussions, that this error code is quite generic and can be resolved in multiple ways, but nothing works for me so far.

Hello @Piotrek , welcome to the community !

The URL you are trying to hit is for Elasticsearch but the port and API being used is for Kibana. If you want to get Kibana status, you need to query the endpoint exposed for Kibana and not ES. So, your curl should be something like:
curl -X "GET" "http://<my-**kibana**-host>:5601/status" --user <my-username> --noproxy '*' -H 'kbn-xsrf: true

Hey @Ayush_Mathur , many thanks for your responce. Indeed I have changed url to kibana one (one I use to connect via web), also needed to add cert, as I have kibana only on https. Now my curl loos like this:

curl -X "GET" "https://<my-kibana-host>/kibana:5601/status" --user --noproxy '*' -H 'kbn-xsrf: true' --cacert cert.pem

Unfortunatelly I still receive same result:

{"statusCode":404,"error":"Not Found","message":"Not Found"}

Do you have any idea how to debug this?

Have you tried using /api/status instead of just /status ?

Yes that helped, thank you!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.