Professional Documents
Culture Documents
Kibana Search
Kibana Visualizations
Kibana Geovisualizations
Kibana Dashboards
Visualizations
Topics
• Behind the Visualizations
• More Types of Visualizations
• Improving Visualizations
Lesson 1
Behind the Visualizations
Overview
• Data is often complex and involves many dimensions
• Often, we want summarized insights:
‒ slices based on specific attributes
‒ calculations based on specific attributes
‒ ...
• Spreadsheets might fulfill this using a "pivot table"
• In the Elastic Stack we call the equivalent functionality an
aggregation
• All aggregations are performed in elasticsearch
‒ Kibana just displays the results
Elasticsearch
users
{
{
{
"User": "Bill", "User": "Marie", "User": "Claire",
"Age": 30, "Age": 32, "Age": 32,
"Country": "FR", "Country": "US", "Country": "US",
"Category": "A" "Category": "A" "Category": "A"
} } }
{ { {
"User": "Tom", "User": "John", "User": "Emma",
"Age": 44, "Age": 40, "Age": 26,
"Country": "DE", "Country": "US", "Country": "US",
"Category": "B" "Category": "B"
"Category": "B"
} } }
Elasticsearch
{
"aggregations": {
"avg_of_age": {
"avg": {
{
{
{ "field": "age"
"User": "Bill", "User": "Marie", "User": "Claire", }
"Age": 30, "Age": 32, "Age": 32, }
"Country": "FR", "Country": "US", "Country": "US", }
"Category": "A" "Category": "A" "Category": "A" }
} } }
{ { {
"User": "Tom", "User": "John", "User": "Emma",
"Age": 44, "Age": 40, "Age": 26,
"Country": "DE", "Country": "US", "Country": "US", "aggregations" : {
"Category": "B" "Category": "B"
"Category": "B"
"avg_of_age" : {
} } } "value" : 34.0
}
}
COUNT AVG of
Rows Values category
of age age
Order ASC by COUNT of age A 3 31.33
category AVG of age B 3 36.66
COUNT AVG of
category country
Rows Values of age age
Bucket: B
Count: 3
Bucket: DE Bucket: US
Count: 1 Count: 2
Avg of age: 44 Avg of age: 33
{ { {
"User": "Tom", "User": "John", "User": "Emma",
"Age": 44, "Age": 40, "Age": 26,
"Country": "DE", "Country": "US", "Country": "US",
"Category": "B" "Category": "B"
"Category": "B"
} } }
Metrics Aggregation 6
Count of Documents
Metrics
2
Aggregation
1
0
US FR DE
Bucket Aggregation
Copyright Elasticsearch BV 2015-2019 Copying, publishing and/or
distributing without written permission is strictly prohibited !121
Sub-bucket Aggregations
Sub-Bucket Aggregation
4
A
3 B
Metrics
2
Aggregation
1
0
US FR DE
Bucket Aggregation
Copyright Elasticsearch BV 2015-2019 Copying, publishing and/or
distributing without written permission is strictly prohibited !122
Kibana Visualizations
Lesson 1
Review - Behind the
Visualizations
Summary
• Kibana renders visualizations using the results of
Elasticsearch aggregations
• There are two main types of aggregations:
‒ metric
‒ bucket
• Metric aggregations are used to compute numeric values
• Bucket aggregations are used to group data together
US
FR
DE
Lesson 1
Lab - Behind the Visualizations
Kibana Visualizations
Lesson 2
More Types of Visualizations
Pivot Table in Kibana
• Aggregations and pivot tables are two concepts that are
very similar
• By using the data table visualization it is possible to have a
"pivot table" like structure in Kibana
• What aggregations are needed in order to generate the
following table?
Category Country Count Average(age)
Category A US 2 32
Category A FR 1 30
Category B US 2 33
Category B DE 1 44
Copyright Elasticsearch BV 2015-2019 Copying, publishing and/or
distributing without written permission is strictly prohibited !128
Pivot Table
• We need the following to create the table:
‒ a bucket aggregation of type terms on the category field first
‒ a sub-bucket aggregation of type terms on the country field
‒ a metric aggregation of type count (default metric aggregation)
on all generated buckets
‒ another metrics aggregation of type average on the age field
on all the generated buckets
Count
Category Count
Category A 3
Category B 3
Category A US 2
Category A FR 1
Category B US 2
Category B DE 1
Category A
Category B
Bucket Aggregations DE US FR
0k-10k
10k-20k
20k-30k
30k-40k
40k-50k
50k-60k
60k-70k
70k-80k
Marie
John
Bill
Tom
Emma
Lesson 2
Review - More Types of
Visualizations
Summary
• Kibana provides a lot of ways to visually represent data.
• Elasticsearch aggregation concepts are central to building
Kibana visualization
• In Heat Maps, bucket aggregations on X and Y axis
produce the cells of the matrix and the result of a metrics
aggregation determines color or intensity of individual cells
Lesson 2
Lab - More Types of
Visualizations
Kibana Visualizations
Lesson 3
Improving Visualizations
Comparing Multiple Metrics
Bucket Aggregation
?
4 40
3 30
Document count
Average age
Metrics
2 20
Aggregation
1 10
0 0
US FR DE
Copyright Elasticsearch BV 2015-2019 Copying, publishing and/or
distributing without written permission is strictly prohibited !144
Visualizing Multiple Metrics
• Multiple metrics can be displayed side by side in the same
visualization
• Having multiple metrics can make the visualization hard to
read for the following reasons:
- the metrics have different scale
- the metrics are stacked (or not, depending of the purpose of the
visualization)
- the metrics have same representations when comparing different
variables (bars, lines, area)
- poor color choice
Different chart
types
4 40
3 30
Document count
Average age
2 20
1 10
0 0
US FR DE
Copyright Elasticsearch BV 2015-2019 Copying, publishing and/or
distributing without written permission is strictly prohibited !151
Multi Charts
2 40
Document count
Average age
Category A 1 20
0 0
US FR
2 40
Document count
Average age
Category B
1 20
0 0
US DE
Instructor Demo
Lesson 3
Review - Improving Visualizations
Summary
• Multiple metrics can be displayed in a single visualization
• Every metric can be customized with a dedicated axis,
different color, style, ...
• It is possible to create multiple charts inside a single
visualization by using a bucket aggregation to divide the
data