-
Notifications
You must be signed in to change notification settings - Fork 156
Background search in Discover and Dashboards #3455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
florent-leborgne
wants to merge
4
commits into
elastic:main
Choose a base branch
from
florent-leborgne:background-search
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
--- | ||
navigation_title: "Run queries in the background" | ||
mapped_pages: | ||
- https://www.elastic.co/guide/en/kibana/current/search-sessions.html | ||
applies_to: | ||
stack: preview 9.2 | ||
serverless: unavailable | ||
products: | ||
- id: kibana | ||
description: Send your long-running queries to run in the background with background searches and search sessions, and focus on your other tasks while they complete. | ||
--- | ||
|
||
# Run Discover and Dashboards queries in the background | ||
|
||
::::{important} - Background search replaces Search sessions | ||
|
||
Background search is a feature introduced in version 9.2. It replaces the deprecated **Search sessions** feature. | ||
If you have been using search sessions and upgrade to 9.2, your search sessions aren't lost and become background searches. | ||
:::: | ||
|
||
Sometimes you might need to search through large amounts of data, no matter how long the search takes. Consider a threat hunting scenario, where you need to search through years of data. | ||
|
||
You can send your long-running searches to the background from **Discover** or **Dashboards** and let them run while you continue your work. | ||
|
||
A notification appears when a background search has completed, and allows you to open the list of background searches. You can also access that list at any time to check the status of your searches and interact with them from the {icon}`background_task` **Background searches** button in the toolbar. | ||
|
||
 | ||
|
||
|
||
## Enable background searches | ||
|
||
This feature is disabled by default. You can enable background searches in versions 9.2 and higher, or search sessions in versions 9.1 and lower, by setting [`data.search.sessions.enabled`](kibana://reference/configuration-reference/search-sessions-settings.md) to `true` in the [`kibana.yml`](/deploy-manage/stack-settings.md) configuration file. | ||
|
||
:::{note} - Exception for search sessions users | ||
If you upgrade to version 9.2 or higher with search sessions enabled in the version you upgrade from, background searches are automatically enabled. | ||
::: | ||
|
||
## Usage requirements [_requirements] | ||
|
||
The background searches that you run are personal and only visible by you. To be able to use this feature, you must have the following minimum permissions: | ||
|
||
:::::{tab-set} | ||
:group: background search | ||
|
||
::::{tab-item} 9.2 and later | ||
:sync: 92 | ||
To send searches to the background, and to view and interact with the list of background searches from **Discover** and **Dashboards** apps, you must have permissions for **Discover** and **Dashboard**, and for the [Background search subfeature](../../deploy-manage/users-roles/cluster-or-deployment-auth/kibana-privileges.md#kibana-feature-privileges). | ||
:::: | ||
|
||
::::{tab-item} 9.1 and earlier | ||
:sync: 91 | ||
In versions 9.1 and earlier, this feature is named **Search sessions**. | ||
* To save a session, you must have permissions for **Discover** and **Dashboard**, and the [Search sessions subfeature](../../deploy-manage/users-roles/cluster-or-deployment-auth/kibana-privileges.md#kibana-feature-privileges). | ||
* To view and restore a saved session, you must have access to **Stack Management**. | ||
:::: | ||
|
||
::::: | ||
|
||
## Send a search to the background | ||
|
||
You can send a search to the background only after it starts running. Until then, the **Send to background** button is disabled. | ||
|
||
1. Write or edit the query. | ||
|
||
1. Select {icon}`play` **Run** (or {icon}`refresh` **Refresh** if you already ran the query at least once) to start executing the query. At this point, the {icon}`background_task` **Send to background** button becomes available. | ||
|
||
1. Select {icon}`background_task` **Send to background**. The search is sent to the background and added to the queue of background searches. | ||
|
||
You can resume your other tasks, for example start a new search, navigate to a different application, or close the browser. Once the search has completed, a notification informs you and lets you access the search to view its results. | ||
|
||
Background searches expire after 7 days. Beyond that period, you must run the search again. | ||
|
||
## Reopen or manage background searches | ||
|
||
From the list of background searches, you can reopen and edit any searches, but also extend their validity period or delete them to keep only searches that you care about. | ||
|
||
1. Open your list of background searches using one of the following methods: | ||
- Once a background search has completed, a notification appears to inform you, with a link to open the list of background searches. | ||
- If you miss the notification or need to access this list at any time, go to **Discover** or **Dashboards** and select the {icon}`background_task` **Background searches** button in the toolbar. This option is only available from version 9.2. | ||
|
||
:::{tip} | ||
From **Discover**, you can only view Discover background searches. And from **Dashboards**, you can only see Dashboards background searches. | ||
::: | ||
- Open the **Background Search** management page in {{kib}}. | ||
|
||
1. Find the background search that you want to interact with using the search or status filter options. | ||
- To open it to view its results and continue your explorations, select its name. Relative dates are converted to absolute dates. | ||
- To rename it, select the {icon}`boxes_horizontal` More actions button, then select {icon}`pencil` **Edit name**. By default, background searches get default names that indicate their execution date and time. | ||
- To extend its current expiration date by another 7 days, select the {icon}`boxes_horizontal` More actions button, then select **Extend**. | ||
- To delete it, select the {icon}`boxes_horizontal` More actions button, then select {icon}`trash` **Delete**. | ||
|
||
|
||
## Background search limitations in dashboards [_limitations] | ||
|
||
Some visualization features do not fully support background searches. When you restore a dashboard, panels with unsupported features won’t load immediately, but instead send out additional data requests, which can take a while to complete. The **Your background search is still running** warning appears. You can either wait for these additional requests to complete or come back to the dashboard later when all data requests have finished. | ||
|
||
A panel on a dashboard can behave like this if one of the following features is used: | ||
|
||
**Lens** | ||
|
||
* A **top values** dimension with an enabled **Group other values as "Other"** setting. This is configurable in the **Advanced** section of the dimension. | ||
* An **intervals** dimension. | ||
|
||
**Aggregation-based** visualizations | ||
|
||
* A **terms** aggregation with an enabled **Group other values in separate bucket** setting. | ||
* A **histogram** aggregation. | ||
|
||
**Maps** | ||
|
||
* Layers using joins, blended layers, or tracks layers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.