Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run an elasticsearch aggregation query in Kibana?

I would like to run the following aggregation query in Kibana:

GET _search
{
  "size": 0,
  "aggs": {
    "group_by_host": {
      "terms": {
        "field": "host",
        "size": 20
      }
    }
  }
}

I can run it in Sense - Kibana, but I would like to run it in the Kibana proper. Having a hard time figuring it out.

like image 393
mark Avatar asked May 16 '16 02:05

mark


People also ask

How do I query Elasticsearch data in Kibana?

Open the main menu, and select Discover. Select the data you want to work with. Kibana uses a data view to tell it where to find your Elasticsearch data. To view the ecommerce sample data, open the data view menu, and then select Kibana Sample Data Ecommerce.

How do you do aggregation in Kibana?

Choose the type of visualization you want to create, then use the editor to configure the options. On the dashboard, click All types > Aggregation based. Select the visualization type you want to create. Select the data source you want to visualize.

What is terms aggregation in Kibana?

What is Kibana Aggregation? Aggregation refers to the collection of documents or a set of documents obtained from a particular search query or filter. Aggregation forms the main concept to build the desired visualization in Kibana.

What is Bucket aggregation in Kibana?

Bucket aggregations don't calculate metrics over fields like the metrics aggregations do, but instead, they create buckets of documents. Each bucket is associated with a criterion (depending on the aggregation type) which determines whether or not a document in the current context "falls" into it.


1 Answers

Just create a Chart from Visualize tab.

Then buckets => X Axis (or Split Rows or whatever based on your chart type) => Terms => Choose your field.

enter image description here

Then click Advanced link and write {"size":10} to there:

enter image description here

Hope that helps!

like image 126
alpert Avatar answered Jan 15 '23 02:01

alpert