You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: explore-analyze/dashboards/add-controls.md
+54Lines changed: 54 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,60 @@ Change the settings for the Options list and Range slider controls.
116
116
1. Hover over the control you want to edit, then click .
117
117
2. On the **Edit control** flyout, change the options, then click **Save and close**.
118
118
119
+
## Add controls from your ES|QL visualization's query [add-esql-control]
120
+
121
+
You can bind controls to your ES|QL visualizations in dashboards. When creating an ES|QL visualization, the autocomplete suggestions
122
+
prompts control insertion for field values, field names, function configuration, and function names. This enables controls that only
123
+
apply to a specific panel, and exposes visualization configuration such as date histogram interval controls to dashboard users.
124
+
125
+
:::{note}
126
+
Currently, only **Options list** control with static values are supported for ES|QL-based controls.
127
+
:::
128
+
129
+
1. While editing your ES|QL visualization's query, the autocomplete menu suggests adding a control.
130
+
131
+

132
+
133
+
2. A menu opens to let you configure the control. This is where you can specify:
134
+
135
+
* The name of the control. That is the name that will appear in your ES|QL query, prefixed with a `?` symbol.
136
+
* Values available to select for users with this control. You can add multiple values from suggested fields, or type in custom values.
137
+
* The label of the control. This is the label displayed for users viewing the dashboard for that control.
138
+
* The width of the control.
139
+
140
+

141
+
142
+
3. Save the control. The panel closes and the control's name is inserted into your query.
143
+
144
+
145
+
**Examples**
146
+
147
+
* Integrate filtering into your ES|QL experience
148
+
149
+
```esql
150
+
| WHERE field == ?value
151
+
```
152
+
153
+
* Fields in controls for dynamic group by
154
+
155
+
```esql
156
+
| STATS count=COUNT(*) BY ?field
157
+
```
158
+
159
+
* Variable time ranges? Bind function configuration settings to a control
160
+
161
+
```esql
162
+
| BUCKET(@timestamp, ?interval),
163
+
```
164
+
165
+
* Make the function itself dynamic
166
+
167
+
```esql
168
+
| STATS metric = ?function
169
+
```
170
+
171
+

Copy file name to clipboardExpand all lines: explore-analyze/discover/try-esql.md
+19-8Lines changed: 19 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ mapped_pages:
10
10
11
11
The Elasticsearch Query Language, {{esql}}, makes it easier to explore your data without leaving Discover.
12
12
13
-
In this tutorial we’ll use the {{kib}} sample web logs in Discover and Lens to explore the data and create visualizations.
13
+
The examples on this page use the {{kib}} sample web logs in Discover and Lens to explore the data and create visualizations. You can also install it by following [Add sample data](../index.md#gs-get-data-into-kibana).
14
14
15
15
::::{tip}
16
16
For the complete {{esql}} documentation, refer to the [{{esql}} documentation](../query-filter/languages/esql.md). For a more detailed overview of {{esql}} in {{kib}}, refer to [Use {{esql}} in Kibana](../query-filter/languages/esql-kibana.md).
@@ -28,14 +28,17 @@ To view the {{esql}} option in **Discover**, the `enableESQL` setting must be en
28
28
29
29
To load the sample data:
30
30
31
-
1.[Install the web logs sample data](../index.md#gs-get-data-into-kibana).
32
-
2. Go to **Discover**.
33
-
3. Select **Try {{esql}}** from the application menu bar.
31
+
1. Go to **Discover**.
32
+
2. Select **Try {{esql}}** from the application menu bar.
34
33
35
-
Let’s say we want to find out what operating system users have and how much RAM is on their machine.
34
+
:::{tip}
35
+
If you've entered a KQL or Lucene query in the default mode of Discover, it automatically converts to ES|QL.
36
+
:::
36
37
37
-
1. Set the time range to **Last 7 days**.
38
-
2. Copy the query below:
38
+
Let’s say we want to find out what operating system users have and how much RAM is on their machine.
39
+
40
+
3. Set the time range to **Last 7 days**.
41
+
4. Copy the query below:
39
42
40
43
```esql
41
44
FROM kibana_sample_data_logs <1>
@@ -49,7 +52,7 @@ Let’s say we want to find out what operating system users have and how much RA
49
52
Put each processing command on a new line for better readability.
50
53
::::
51
54
52
-
3. Click **▶Run**.
55
+
5. Click **▶Run**.
53
56

54
57
::::{note}
55
58
{{esql}} keywords are not case sensitive.
@@ -128,3 +131,11 @@ FROM kibana_sample_data_ecommerce
The ES|QL editor supports [`LOOKUP JOIN`](elasticsearch://reference/query-languages/esql/esql-commands.md#esql-lookup-join) commands and suggests lookup mode indices and join condition fields.
139
+
140
+

Copy file name to clipboardExpand all lines: explore-analyze/query-filter/languages/esql-kibana.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ To get started with {{esql}}, go to **Discover**. Next, select **Try ES|QL** fro
33
33
34
34
### The query bar [esql-kibana-query-bar]
35
35
36
-
After switching to {{esql}} mode, the query bar shows a sample query. For example:
36
+
After switching to {{esql}} mode, the query bar shows your previous KQL or Lucene query converted into {{esql}}. If the query was empty, it shows a sample query. For example:
37
37
38
38
```esql
39
39
from kibana_sample_data_logs | limit 10
@@ -78,6 +78,7 @@ You can do that using the **Add line breaks on pipes** button from the query edi
You can adjust the editor’s height by dragging its bottom border to your liking.
@@ -235,41 +236,44 @@ You can save the visualization to a new or existing dashboard by clicking the sa
235
236
236
237
You can use {{esql}} queries to create panels on your dashboards. To add a panel to a dashboard, under **Dashboards**, click the **Add panel** button and select {{esql}}.
Check the {{esql}} query by clicking the Panel filters button ():
You can also edit the {{esql}} visualization from here. Click the options button in the top-right () and select **Edit ESQL visualization** to open the in-line editor.
You can also [Add dashboard controls from your ES|QL visualization's query](/explore-analyze/dashboards/add-controls.md#add-esql-control)
254
+
254
255
255
256
## Create an enrich policy [esql-kibana-enrich]
256
257
257
258
The {{esql}} [`ENRICH`](elasticsearch://reference/query-languages/esql/esql-commands.md#esql-enrich) command enables you to [enrich](elasticsearch://reference/query-languages/esql/esql-enrich-data.md) your query dataset with fields from another dataset. Before you can use `ENRICH`, you need to [create and execute an enrich policy](elasticsearch://reference/query-languages/esql/esql-enrich-data.md#esql-set-up-enrich-policy). If a policy exists, it will be suggested by auto-complete. If not, click **Click to create** to create one.
Copy file name to clipboardExpand all lines: explore-analyze/visualize/esorql.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,4 +31,20 @@ You can then **Save** and add it to an existing or a new dashboard using the sav
31
31
32
32

33
33
34
-
4. Select **Apply and close** to save the visualization to the dashboard.
34
+
4. You can bind controls to your ES|QL visualizations in dashboards by creating [ES|QL controls](../dashboards/add-controls.md#add-esql-control).
35
+
5. Select **Apply and close** to save the visualization to the dashboard.
36
+
37
+
38
+
## Customize the appearance of your {{esql}} visualization
39
+
40
+
When editing an {{esql}} visualization, you can customize the appearance of the chart. To do that:
41
+
42
+
1. Click one of the fields representing an axis of the chart to open its details.
43
+
44
+

45
+
46
+
2. Define the appearance of your choice from the available options.
47
+
48
+

49
+
50
+
3. Return to the previous menu, then **Apply and close** the configuration to save your changes.
0 commit comments