Kibana querys

Hello everybody!
I have next questions:

  1. I have 3 fields: Peoples(Name) and Orders(number of orders on the website).
    One person can order 2 books, second - 3 and etc.
    I need to count, how many orders person has and visualize it in datatable with his ID.
    How can I do it in kibana?
    2)Can I make a query in kibana, like in sql, using WHERE, GROUP BY,Count,If and etc.
    Many thanks!

Hello Sergey,

Elasticsearch is not a SQL database, so you cannot just use SQL queries (though there are efforts to build a layer, that accepts SQL plugins - though that doesn't mean that will ever be possible inside Kibana).

In Elasticsearch you work a lot with aggregation to aggregate (GROUP BY) your data together, and with filters and queries to filter it (WHERE).

What you are looking into is most likely, doing a terms aggregation on the customer_id (or whatever it's called) field. That way you would get the count of documents for each customer_id. If you have a field in there with the actual amount that was ordered, instead of using the count aggregation as a metrics aggregation, you could switch to a sum aggregation on that field. Now the value wouldn't be the amount of documents, but the actual sum of all orders in those documents.

Cheers,
Tim

Thank you Tim for reply!
I already found an easy way to do it)

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