-
Notifications
You must be signed in to change notification settings - Fork 156
Variable controls in Discover #3440
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
7
commits into
elastic:main
Choose a base branch
from
florent-leborgne:controls-in-discover
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
7 commits
Select commit
Hold shift + click to select a range
7a9f3b6
Variable controls in Discover
florent-leborgne 36ee435
Update explore-analyze/_snippets/variable-control-examples.md
florent-leborgne 6ec30a5
Update explore-analyze/_snippets/variable-control-examples.md
florent-leborgne 62c4b5d
Update explore-analyze/_snippets/import-discover-query-controls-into-…
florent-leborgne 20fb738
Update explore-analyze/_snippets/variable-control-form.md
florent-leborgne aa7f2d0
Update explore-analyze/_snippets/variable-control-form.md
florent-leborgne eb97682
Update explore-analyze/_snippets/import-discover-query-controls-into-…
florent-leborgne 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
17 changes: 17 additions & 0 deletions
17
explore-analyze/_snippets/import-discover-query-controls-into-dashboard.md
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,17 @@ | ||
To add a Discover query to a dashboard in a way that preserves the [controls created from Discover](/explore-analyze/discover/try-esql.md#add-variable-control-discover) and also adds them to the dashboard, do as follows: | ||
|
||
1. Save the {{esql}} query containing the variable control into a Discover session. If your Discover session contains several tabs, only the first tab will be imported to the dashboard. | ||
|
||
1. Go to **Dashboards** and open or create one. | ||
|
||
1. Select **Add**, then **From library**. | ||
|
||
1. Find and select the Discover session you saved earlier. | ||
|
||
A new panel appears on the dashboard with the results of the query along with any attached controls. | ||
|
||
 | ||
|
||
:::{note} | ||
When you add a visualization to a dashboard using the {icon}`save` **Save visualization** option, controls are not added to the dashboard. | ||
::: |
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,25 @@ | ||
**Examples** | ||
|
||
* Integrate filtering into your {{esql}} experience | ||
|
||
```esql | ||
| WHERE field == ?value | ||
``` | ||
|
||
* Fields in controls for dynamic group by | ||
|
||
```esql | ||
| STATS count=COUNT(*) BY ??field | ||
``` | ||
|
||
* Variable time ranges? Bind function configuration settings to a control | ||
|
||
```esql | ||
| BUCKET(@timestamp, ?interval), | ||
``` | ||
|
||
* Make the function itself dynamic | ||
|
||
```esql | ||
| STATS metric = ??function | ||
``` |
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,11 @@ | ||
* The type of the control. | ||
* For controls with **Static values**, enter available controls manually or select them from the dropdown list. | ||
* For controls with **Values from a query**, write an {{esql}} query to populate the list of options. | ||
* The name of the control. This name is used to reference the control in {{esql}} queries. | ||
florent-leborgne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Start the name with `?` if you want the options to be simple static values. | ||
* {applies_to}`stack: ga 9.1` Start the name with `??` if you want the options to be fields or functions. | ||
* The values users can select for this control. You can add multiple values from suggested fields, or type in custom values. If you selected **Values from a query**, you must instead write an {{esql}} query at this step. | ||
* The label of the control. This is the label displayed in **Discover** or in the dashboard. | ||
florent-leborgne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* The width of the control. | ||
|
||
 |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.