Is there a Kibana health API for load balancer?

Tried the following URL https://localhost:5601/[token]/api/status on 5.5.2 which works fine and returned the health information. However, the is changed every time after restarting kibana instances. Is there a way to have a static URL without the token in the URL to check the health of Kibana instances?

Thanks,
KC

Depends on what you want to achieve. If you just want to let the LB know if the node is OK, check the status returned by /status:

kibana-b :: ~ »  curl -I  http://127.0.0.1:5601/status
HTTP/1.1 200 OK
kbn-name: kibana
kbn-version: 6.2.3
...

If you want detailed status, just omit the token:

kibana-b :: ~ » curl -s http://127.0.0.1:5601/api/status | json_pp
{
   "version" : {
      "number" : "6.2.3",
      "build_snapshot" : false,
      "build_number" : 16602,
      "build_hash" : "2582ab6060209a9fc6a67275fc52ce08ae74c957"
   },
   "status" : {
      "overall" : {
         "since" : "2018-03-21T09:52:41.957Z",
         "nickname" : "Looking good",
         "state" : "green",
         "title" : "Green",
         "icon" : "success"
      },
      "statuses" : [
         {
            "message" : "Ready",
            "since" : "2018-03-21T09:52:41.957Z",
            "id" : "plugin:kibana@6.2.3",
            "state" : "green",
            "icon" : "success"
         },
...

Thanks vvlad! It looks 6.2.x has better support for checking the health status, while 5.5.2 has different results as below. For the details of the status, it seems the token cannot be ignored in 5.5.2. is there a way to omit the token in 5.5.2?

curl -I localhost:5601/status
HTTP/1.1 302 Found
location: https://localhost:5601/status
cache-control: no-cache
Date: Wed, 21 Mar 2018 17:23:22 GMT
Connection: keep-alive
curl -k -s  https://localhost:5601/izw/api/status | json_pp
{
   "status" : {
      "overall" : {
         "since" : "2018-03-21T17:23:02.492Z",
         "state" : "green",
         "title" : "Green",
         "nickname" : "Looking good",
         "icon" : "success"
      },
      "statuses" : [
         {
            "message" : "Ready",
            "id" : "ui settings",
            "since" : "2018-03-21T17:23:02.607Z",
            "state" : "green",
            "icon" : "success"
         },
         {
            "state" : "green",
            "since" : "2018-03-21T17:23:02.492Z",
            "id" : "plugin:kibana@5.5.2",
            "message" : "Ready",
            "icon" : "success"
         },
         {
...
curl -k -s  https://localhost:5601/api/status | json_pp
{
   "statusCode" : 404,
   "error" : "Not Found"
}

curl -s  http://localhost:5601/api/status | json_pp
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/bin/json_pp5.18 line 45.

I’m not particularly familiar with kibana 5. I just poked around version 6.2 for this.
As far as I can remember, in case something was wrong, the pages wouldn’t return HTTP 200 even in version 5. I used to just point the load balancer health checker to the root URL.

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