Using Background Tasks
Background tasks are search queries that can be executed in the background without blocking the search interface. This is useful for long-running operations that require significant computational resources. The results of background queries are stored on disk and are available for a specified period, defined in the cluster settings.
Starting a Background Task
To start a background task, enter a query in the search bar, enable the Send to Background
option, and click the Send
button.
Viewing Results of Background Tasks
The results of background tasks are available in the Main -> Background Tasks
section.
The page displaying the results of background tasks is a table containing the following columns:
Column | Description |
---|---|
ID | A unique identifier for the background task (ID ). Clicking on the ID opens a search window with the results of this task. |
Query | The search query used in this background task. |
Owner | The user who initiated the background task. |
Created | The date and time the background task was started. |
Duration | The execution time of the background task. |
Status | The status of the background task. |
Actions | The last column contains a menu with available actions: |
- Export Results — exports the result of the background task to a file. | |
- Delete — deletes the result of the background task from disk. |
At the top of the page, there is a search bar and a button to refresh the table.
Exporting Results of a Background Task
Once a background search query is completed, the option to export the results to a file becomes available.
When you click the Export Results
button, a modal window opens where you need to enter the File Name
and select the File Type
. Additionally, you can choose to compress the downloaded file into a zip archive, set the maximum number of events to export, or export all results.
The available formats for export are xlsx
, json
, and csv
.
If you select the Compress results into a zip archive
option, a zip archive containing the events in the chosen export format will be downloaded.
With these settings, after clicking the Export
button, a file named test.json
will be downloaded, containing up to 10,000
events from the result of the background task.
System Settings for Background Tasks
The settings for background tasks are stored in _cluster/settings
. Below is a table with the background task settings and their default values.
Name | Description | Default Value |
---|---|---|
sme.core.background_search.hits_in_file | Maximum number of events in a file on disk. | 100 |
sme.core.background_search.result_ttl | Time-to-live for the result of a background task, in seconds. | 86400 |
sme.core.background_search.auto_purge_interval | Interval for cleaning up outdated background task results, in seconds. | 60 |
sme.core.background_search.timeout | Timeout for executing background tasks, in seconds. | 1800 |