2021-04-13 16:49:38 +02:00
|
|
|
|
[[save-load-delete-query]]
|
2021-04-21 20:02:00 +02:00
|
|
|
|
=== Save a query
|
2021-04-13 16:49:38 +02:00
|
|
|
|
|
2021-04-21 20:02:00 +02:00
|
|
|
|
Have you ever built a query that you wanted to reuse?
|
|
|
|
|
With saved queries, you can save your query text, filters, and time range for
|
|
|
|
|
reuse anywhere a query bar is present.
|
2021-04-13 16:49:38 +02:00
|
|
|
|
|
2021-04-21 20:02:00 +02:00
|
|
|
|
For example, suppose you're in *Discover*, and you've put time into building
|
|
|
|
|
a query that includes query input text, multiple filters, and a specific time range.
|
|
|
|
|
Save this query, and you can embed the search results in dashboards,
|
|
|
|
|
use them as a foundation for building a visualization,
|
|
|
|
|
and share them in a link or CVS form.
|
|
|
|
|
|
|
|
|
|
[role="screenshot"]
|
|
|
|
|
image:concepts/images/saved-query.png["Example of the saved query management popover with a list of saved queries"]
|
2021-04-13 16:49:38 +02:00
|
|
|
|
|
|
|
|
|
|
2021-04-21 20:02:00 +02:00
|
|
|
|
Saved queries are different than <<save-open-search,saved searches>>,
|
|
|
|
|
which include the *Discover* configuration—selected columns in the document table, sort order, and
|
|
|
|
|
index pattern—in addition to the query.
|
|
|
|
|
Saved searches are primarily used for adding search results to a dashboard.
|
|
|
|
|
|
|
|
|
|
[role="xpack"]
|
|
|
|
|
==== Read-only access
|
|
|
|
|
If you have insufficient privileges to save queries,
|
|
|
|
|
the *Save* button isn't visible in the saved query management popover.
|
2021-04-13 16:49:38 +02:00
|
|
|
|
For more information, see <<xpack-security-authorization, Granting access to Kibana>>
|
|
|
|
|
|
2021-04-21 20:02:00 +02:00
|
|
|
|
==== Save a query
|
|
|
|
|
|
|
|
|
|
. Once you’ve built a query worth saving, click the save query icon image:concepts/images/save-icon.png["save query icon"].
|
2021-04-13 16:49:38 +02:00
|
|
|
|
. In the popover, click *Save current query*.
|
2021-04-21 20:02:00 +02:00
|
|
|
|
. Enter a unique name to identify the query and an optional description that will appear in a tooltip in the saved query popover.
|
|
|
|
|
. Choose whether to include or exclude filters and a time range.
|
2021-04-13 16:49:38 +02:00
|
|
|
|
By default, filters are automatically included, but the time filter is not.
|
|
|
|
|
+
|
|
|
|
|
[role="screenshot"]
|
2021-07-19 17:41:19 +02:00
|
|
|
|
image:concepts/images/saved-query-popup.png["Example of the saved query management popover with a list of saved queries", width=50%]
|
2021-04-21 20:02:00 +02:00
|
|
|
|
|
2021-04-13 16:49:38 +02:00
|
|
|
|
. Click *Save*.
|
2021-04-21 20:02:00 +02:00
|
|
|
|
. To load a saved query, select it in the *Saved query* popover.
|
2021-04-13 16:49:38 +02:00
|
|
|
|
+
|
2021-04-21 20:02:00 +02:00
|
|
|
|
The query text, filters, and time range are updated and your data refreshed.
|
|
|
|
|
If you’re loading a saved query that did not include the filters or time range, those components remain as-is.
|
|
|
|
|
. To clear, modify, and delete saved queries, use the *Saved query* popover.
|