EnnioMorricone
EnnioMorricone

Reputation: 57

How to query Kibana data through REST API

I have access to someone's Kibana dashboard. I want a programmatic way of accessing the data there from one of the panels. Is there a way to do this ? eg: Is there is a REST API access to query for data with parameters like time range.

Upvotes: 3

Views: 12442

Answers (3)

Nu-ONE
Nu-ONE

Reputation: 699

You can get the data used in the panel by going to

  1. that particular visualization and
  2. go to Inspect
  3. click request and copy

This request can be used in a curl command or in a rest call to get the data you saw in the panel enter image description here

Upvotes: 5

Amit
Amit

Reputation: 32376

If you know the backing elasticsearch index of Kibana dashboard, then you can query the data in same way you query the data from elasticsearch. Kibana is just a visualisation tool and Its data is backed by elasticsearch, Please refer ELK stack for more info.

Elasticsearch provides all the search and index functionality in form of REST endpoint and, you can easily build your search query against the elasticsearch index and get the data you want pragmatically.

Upvotes: 1

Dennis Kozevnikoff
Dennis Kozevnikoff

Reputation: 2277

Go to your Kibana page by entering the appropriate URL and port, such as:

192.241.122.33:5601

On the left hand side, in the top corner, select the wavy line square, scroll down, and select

Dev Tools

Once you are in the query console, execute a query. The simplest one would be to just select everything from a particular table, such as:

POST /_sql?format=json
{
    "query": "SELECT * FROM users"
}

Upvotes: 1

Related Questions