浏览代码

[DOCS] Update Using ESQL in Kibana doc (#108715)

* [DOCS] Update Using ESQL in Kibana doc

* Add dashboard panel instructions,screenshots

* Add query history info, images

* Update enabling ESQL info
Liam Thompson 1 年之前
父节点
当前提交
4e04bf19ce

+ 59 - 19
docs/reference/esql/esql-kibana.asciidoc

@@ -13,21 +13,28 @@ queries, load the "Sample web logs" sample data set by clicking *Try sample
 data* from the {kib} Home, selecting *Other sample data sets*, and clicking *Add
 data* on the *Sample web logs* card.
 
+[discrete]
+[[esql-kibana-enable]]
+=== Enable or disable {esql}
+
+{esql} is enabled by default in {kib}. It can be
+disabled using the `enableESQL` setting from the
+{kibana-ref}/advanced-options.html[Advanced Settings].
+
+This will hide the {esql} user interface from various applications.
+However, users will be able to access existing {esql} artifacts like saved searches and visualizations.
+
 [discrete]
 [[esql-kibana-get-started]]
 === Get started with {esql}
 
 // tag::esql-mode[]
 To get started with {esql} in Discover, open the main menu and select
-*Discover*. Next, from the Data views menu, select *Try ES|QL*.
+*Discover*. Next, from the Data views menu, select *Language: ES|QL*.
 
 image::images/esql/esql-data-view-menu.png[align="center",width=33%]
 // end::esql-mode[]
 
-The ability to select {esql} from the Data views menu can be enabled and
-disabled using the `discover:enableESQL` setting from
-{kibana-ref}/advanced-options.html[Advanced Settings].
-
 [discrete]
 [[esql-kibana-query-bar]]
 === The query bar
@@ -47,7 +54,7 @@ A source command can be followed by one or more <<esql-commands,processing
 commands>>. In this query, the processing command is <<esql-limit>>. `LIMIT`
 limits the number of rows that are retrieved.
 
-TIP: Click the help icon (image:images/esql/esql-icon-help.svg[]) to open the
+TIP: Click the help icon (image:images/esql/esql-icon-help.svg[Static,20]) to open the
 in-product reference documentation for all commands and functions.
 
 // tag::autocomplete[]
@@ -98,6 +105,19 @@ A query may result in warnings, for example when querying an unsupported field
 type. When that happens, a warning symbol is shown in the query bar. To see the
 detailed warning, expand the query bar, and click *warnings*.
 
+[discrete]
+[[esql-kibana-query-history]]
+==== Query history
+
+You can reuse your recent {esql} queries in the query bar.
+In the query bar click *Show recent queries*:
+
+image::images/esql/esql-discover-show-recent-query.png[align="center",size="50%"]
+
+You can then scroll through your recent queries:
+
+image::images/esql/esql-discover-query-history.png[align="center",size="50%"]
+
 [discrete]
 [[esql-kibana-results-table]]
 === The results table
@@ -170,7 +190,7 @@ FROM kibana_sample_data_logs
 === Analyze and visualize data
 
 Between the query bar and the results table, Discover shows a date histogram
-visualization. If the indices you're querying do not contain an `@timestamp`
+visualization. If the indices you're querying do not contain a `@timestamp`
 field, the histogram is not shown.
 
 The visualization adapts to the query. A query's nature determines the type of
@@ -189,24 +209,39 @@ The resulting visualization is a bar chart showing the top 3 countries:
 
 image::images/esql/esql-kibana-bar-chart.png[align="center"]
 
-To change the visualization into another type, click the visualization type
-dropdown:
-
-image::images/esql/esql-kibana-visualization-type.png[align="center",width=33%]
-
-To make other changes to the visualization, like the axes and colors, click the
+To make changes to the visualization, like changing the visualization type, axes and colors, click the
 pencil button (image:images/esql/esql-icon-edit-visualization.svg[]). This opens
 an in-line editor:
 
-image::images/esql/esql-kibana-in-line-editor.png[align="center"]
+image::images/esql/esql-kibana-in-line-editor.png[align="center",width=66%]
 
 You can save the visualization to a new or existing dashboard by clicking the
 save button (image:images/esql/esql-icon-save-visualization.svg[]). Once saved
-to a dashboard, you can continue to make changes to visualization. Click the
+to a dashboard, you'll be taken to the Dashboards page. You can continue to 
+make changes to the visualization. Click the
 options button in the top-right (image:images/esql/esql-icon-options.svg[]) and
 select *Edit ESQL visualization* to open the in-line editor:
 
-image::images/esql/esql-kibana-edit-on-dashboard.png[align="center"]
+image::images/esql/esql-kibana-edit-on-dashboard.png[align="center",width=66%]
+
+[discrete]
+[[esql-kibana-dashboard-panel]]
+==== Add a panel to a dashboard
+
+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}.
+
+image::images/esql/esql-dashboard-panel.png[align="center",width=50%]
+
+Check the {esql} query by clicking the Panel filters button (image:images/esql/dashboard_panel_filter_button.png[Panel filters button on panel header]):
+
+image::images/esql/esql-dashboard-panel-query.png[align="center",width=50%]
+
+You can also edit the {esql} visualization from here.
+Click the options button in the top-right (image:images/esql/esql-icon-options.svg[]) and
+select *Edit ESQL visualization* to open the in-line editor.
+
+image::images/esql/esql-dashboard-panel-edit-visualization.png[align="center",width=50%]
 
 [discrete]
 [[esql-kibana-enrich]]
@@ -233,7 +268,14 @@ Finally, click *Create and execute*.
 
 Now, you can use the enrich policy in an {esql} query:
 
-image::images/esql/esql-kibana-enriched-data.png[align="center"]
+[source,esql]
+----
+FROM kibana_sample_data_logs
+| STATS total_bytes = SUM(bytes) BY geo.dest
+| SORT total_bytes DESC
+| LIMIT 3
+| ENRICH countries
+----
 
 [discrete]
 [[esql-kibana-alerting-rule]]
@@ -254,8 +296,6 @@ image::images/esql/esql-kibana-create-rule.png[align="center",width=50%]
 * The user interface to filter data is not enabled when Discover is in {esql}
 mode. To filter data, write a query that uses the <<esql-where>> command
 instead.
-* In {esql} mode, clicking a field in the field list in Discover does not show
-quick statistics for that field.
 * Discover shows no more than 10,000 rows. This limit only applies to the number
 of rows that are retrieved by the query and displayed in Discover. Queries and
 aggregations run on the full data set.

二进制
docs/reference/images/esql/dashboard_panel_filter_button.png


二进制
docs/reference/images/esql/esql-dashboard-panel-edit-visualization.png


二进制
docs/reference/images/esql/esql-dashboard-panel-query.png


二进制
docs/reference/images/esql/esql-dashboard-panel.png


二进制
docs/reference/images/esql/esql-data-view-menu.png


二进制
docs/reference/images/esql/esql-discover-query-history.png


二进制
docs/reference/images/esql/esql-discover-show-recent-query.png


二进制
docs/reference/images/esql/esql-expanded-query-bar.png


+ 15 - 1
docs/reference/images/esql/esql-icon-help.svg

@@ -1 +1,15 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M9 3.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zM9 5v3h1v1H8V6H7V5h2z"></path><path d="M13.855 14.147a1.34 1.34 0 0 1-.158-.246A1.998 1.998 0 0 1 13.5 13c0-.414.103-.713.197-.901a1.34 1.34 0 0 1 .158-.246l.003-.005A.5.5 0 0 0 14 11.5V.5a.5.5 0 0 0-.5-.5H3.461l-.083.005a2.957 2.957 0 0 0-1.102.298 2.257 2.257 0 0 0-.88.763C1.148 1.44 1 1.913 1 2.5V13c0 .463.117.843.318 1.145.2.298.462.491.708.615a2.344 2.344 0 0 0 .94.24H3v-1c-.005 0-.015 0-.029-.002a1.344 1.344 0 0 1-.498-.133.817.817 0 0 1-.323-.275C2.07 13.47 2 13.287 2 13s.07-.47.15-.59a.817.817 0 0 1 .324-.275A1.344 1.344 0 0 1 3 12h9.658c-.091.27-.158.605-.158 1s.067.73.158 1H8v1h5.5a.5.5 0 0 0 .359-.848l-.004-.005zm-.001 0 .002.002-.002-.002zM2.724 1.197c.092-.046.186-.082.276-.11C3 2.918 3.001 11 2.999 11h-.033a1.977 1.977 0 0 0-.283.03 2.344 2.344 0 0 0-.657.21L2 11.254V2.5c0-.413.102-.689.229-.879.128-.193.304-.328.495-.424zM4 11V1h9v10H4z"></path><path d="M7 13H4v2.5a.5.5 0 0 0 .854.354l.646-.647.646.647A.5.5 0 0 0 7 15.5V13z"></path></svg>
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
+<svg width="800px" height="800px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <title>information_line</title>
+    <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="System" transform="translate(-672.000000, 0.000000)" fill-rule="nonzero">
+            <g id="information_line" transform="translate(672.000000, 0.000000)">
+                <path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fill-rule="nonzero">
+
</path>
+                <path d="M12,2 C17.5228,2 22,6.47715 22,12 C22,17.5228 17.5228,22 12,22 C6.47715,22 2,17.5228 2,12 C2,6.47715 6.47715,2 12,2 Z M12,4 C7.58172,4 4,7.58172 4,12 C4,16.4183 7.58172,20 12,20 C16.4183,20 20,16.4183 20,12 C20,7.58172 16.4183,4 12,4 Z M11.99,10 C12.5478,10 13,10.4522 13,11.01 L13,16.1338 C13.2989,16.3067 13.5,16.6299 13.5,17 C13.5,17.5523 13.0523,18 12.5,18 L12.01,18 C11.4521,18 11,17.5478 11,16.99 L11,12 C10.4477,12 10,11.5523 10,11 C10,10.4477 10.4477,10 11,10 L11.99,10 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55228 12.5523,9 12,9 C11.4477,9 11,8.55228 11,8 C11,7.44772 11.4477,7 12,7 Z" id="形状" fill="#09244B">
+
</path>
+            </g>
+        </g>
+    </g>
+</svg>

二进制
docs/reference/images/esql/esql-kibana-auto-complete.png


二进制
docs/reference/images/esql/esql-kibana-bar-chart.png


二进制
docs/reference/images/esql/esql-kibana-edit-on-dashboard.png


二进制
docs/reference/images/esql/esql-kibana-enrich-autocomplete.png


二进制
docs/reference/images/esql/esql-kibana-in-line-editor.png