Lens helps you explore and visualize your data easily by dragging and dropping fields. It makes understanding data simple without writing complex queries.
0
0
Lens for drag-and-drop analysis in Elasticsearch
Introduction
You want to quickly create charts from your Elasticsearch data without coding.
You need to explore trends or patterns by moving fields around visually.
You want to compare different data points side-by-side using simple drag-and-drop.
You are new to Elasticsearch and want an easy way to analyze data.
You want to build dashboards with interactive visualizations fast.
Syntax
Elasticsearch
Use the Kibana Lens interface to drag fields from your data panel into the workspace. Choose visualization types like bar, line, pie, or table. Adjust settings like filters, time ranges, and metrics visually.
No code is needed; Lens uses a graphical interface.
Lens automatically suggests the best visualization based on your data.
Examples
This example shows how to create a time series chart by dragging fields.
Elasticsearch
1. Drag a date field to the horizontal axis. 2. Drag a numeric field to the vertical axis. 3. Lens creates a line chart showing values over time.
This example groups data by categories to compare counts visually.
Elasticsearch
1. Drag a keyword field to the breakdown dimension. 2. Drag a count metric to the value area. 3. Lens creates a bar chart grouped by the keyword values.
Sample Program
This JSON represents a Lens line chart showing sales over time, which you create by dragging the date and sales fields in Kibana Lens.
Elasticsearch
/* Lens is a visual tool in Kibana, so no code is needed. Here is a JSON example of a Lens visualization saved in Kibana: */ { "title": "Sales Over Time", "visualizationType": "lnsXY", "state": { "layers": [ { "layerId": "layer1", "xAccessor": "date", "yAccessors": ["sales"], "seriesType": "line", "palette": {"type": "palette", "name": "default"} } ] } }
OutputSuccess
Important Notes
Lens works best with well-structured Elasticsearch data.
You can combine multiple fields and metrics for richer analysis.
Lens updates visualizations instantly as you drag and drop fields.
Summary
Lens lets you analyze Elasticsearch data by dragging and dropping fields.
No coding is needed; it uses a visual interface for quick insights.
You can create many chart types like line, bar, and pie easily.