Given a Lens visualization in Elasticsearch where you drag the "bytes" field to the Y-axis and the "extension.keyword" field to the X-axis, what will the chart display?
Lens config:
- Y-axis: Sum of bytes
- X-axis: Terms of extension.keyword
Data sample:
{
"extension": "jpg",
"bytes": 1000
},
{
"extension": "png",
"bytes": 2000
},
{
"extension": "jpg",
"bytes": 1500
}Think about what happens when you drag a numeric field to the Y-axis and a keyword field to the X-axis in Lens.
Dragging bytes to the Y-axis with aggregation sum and extension.keyword to the X-axis with terms aggregation creates a bar chart showing total bytes per extension.
In Elasticsearch Lens, after dragging a field to an axis, how can you change the aggregation method (e.g., from sum to average)?
Look for interactive controls on the axis field after dragging.
Lens lets you click on the field on the axis to open a menu where you can select aggregation types like sum, average, min, max, etc.
You dragged timestamp to the X-axis and bytes to the Y-axis in Lens, but the chart shows no data. What is the most likely cause?
Lens config:
- X-axis: Date histogram on timestamp
- Y-axis: Sum of bytes
Data sample:
{
"timestamp": "2023-01-01T00:00:00Z",
"bytes": 1000
}
Index pattern uses a different time field named "@timestamp".Check the index pattern's configured time field and the field used in the visualization.
If the index pattern's time field is different from the field used in the date histogram, Lens cannot filter data by time range, resulting in no data shown.
In Lens, you want to create a stacked bar chart showing total bytes per extension, split by the geo.src field. Which drag-and-drop setup achieves this?
Think about which axis shows the main grouping and which field breaks down the bars.
Dragging bytes to Y-axis with sum aggregation, extension.keyword to X-axis, and geo.src.keyword to 'Break down by' creates stacked bars grouped by extension and split by geo.src.
You want a Lens chart that shows the average bytes per day on the Y-axis, with the X-axis as a date histogram on @timestamp, but only for the top 3 file extensions by count. How do you configure Lens?
Consider how to limit the number of extensions shown and how to arrange date histogram and terms fields.
Setting Y-axis to average bytes, X-axis to date histogram on @timestamp, and 'Break down by' to extension.keyword limited to top 3 terms shows average bytes per day split by top 3 extensions.