-
Notifications
You must be signed in to change notification settings - Fork 152
[Kibana]: Rename ES|QL controls to Variable controls #3334
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
alaudazzi
wants to merge
3
commits into
main
Choose a base branch
from
fix-3013
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.
+183
−15
Open
Changes from all commits
Commits
Show all changes
3 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
Some comments aren't visible on the classic Files Changed page.
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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,19 +30,61 @@ There are three types of controls: | |||||
 | ||||||
|
||||||
|
||||||
|
||||||
## Create and add Options list and Range slider controls [create-and-add-options-list-and-range-slider-controls] | ||||||
|
||||||
:::::{applies-switch} | ||||||
::::{applies-item} stack: ga 9.2 | ||||||
To add interactive Options list and Range slider controls, create the controls, then add them to your dashboard. | ||||||
|
||||||
1. Open or create a new dashboard. | ||||||
2. In **Edit** mode, select **Add** > **Controls** > **Control** in the toolbar. | ||||||
3. On the **Create control** flyout, from the **Data view** dropdown, select the data view that contains the field you want to use for the **Control**. | ||||||
4. In the **Field** list, select the field you want to filter on. | ||||||
5. Under **Control type**, select whether the control should be an **Options list** or a **Range slider**. | ||||||
:::{tip} | ||||||
Range sliders are for Number type fields only. | ||||||
::: | ||||||
|
||||||
6. Define how you want the control to appear: | ||||||
|
||||||
* **Label**: Overwrite the default field name with a clearer and self-explanatory label. | ||||||
* **Minimum width**: How much horizontal space does the control occupies. The final width can vary depending on the other controls and their own width setting. | ||||||
* **Expand width to fit available space**: Expand the width of the control to fit the available horizontal space on the dashboard. | ||||||
|
||||||
7. Specify the additional settings: | ||||||
|
||||||
* For Options lists: | ||||||
|
||||||
* Define whether users can select multiple values to filter with the control, or only one. | ||||||
* For Options list controls on *string* and *IP address* type fields, you can define how the control’s embedded search should behave: | ||||||
|
||||||
* **Prefix**: Show options that *start with* the entered value. | ||||||
* **Contains**: Show options that *contain* the entered value. This setting option is only available for *string* type fields. Results can take longer to show with this option. | ||||||
* **Exact**: Show options that are a 100% match with the entered value. | ||||||
|
||||||
:::{tip} | ||||||
The search is not case sensitive. For example, searching for `ios` would still retrieve `iOS` if that value exists. | ||||||
::: | ||||||
|
||||||
* **Ignore timeout for results** delays the display of the list of values to when it is fully loaded. This option is useful for large data sets, to avoid missing some available options in case they take longer to load and appear when using the control. | ||||||
|
||||||
* For Range sliders, set the step size. The step size determines the number of steps of the slider. The smaller the step size is, the more steps there is in the slider. | ||||||
|
||||||
8. Select **Save**. The control can now be used. | ||||||
9. Consider the position of the control if you have several controls active on the dashboard. Controls are applied from left to right, which can change the options available depending on their position when the [Chain controls](#configure-controls-settings) setting is enabled. | ||||||
10. Save the dashboard. | ||||||
:::: | ||||||
::::{applies-item} stack: ga 9.0 | ||||||
To add interactive Options list and Range slider controls, create the controls, then add them to your dashboard. | ||||||
|
||||||
1. Open or create a new dashboard. | ||||||
2. In **Edit** mode, select **Controls** > **Add control** in the dashboard toolbar. | ||||||
3. On the **Create control** flyout, from the **Data view** dropdown, select the data view that contains the field you want to use for the **Control**. | ||||||
4. In the **Field** list, select the field you want to filter on. | ||||||
5. Under **Control type**, select whether the control should be an **Options list** or a **Range slider**. | ||||||
::::{tip} | ||||||
:::{tip} | ||||||
Range sliders are for Number type fields only. | ||||||
:::: | ||||||
::: | ||||||
|
||||||
6. Define how you want the control to appear: | ||||||
|
||||||
|
@@ -61,9 +103,9 @@ To add interactive Options list and Range slider controls, create the controls, | |||||
* **Contains**: Show options that *contain* the entered value. This setting option is only available for *string* type fields. Results can take longer to show with this option. | ||||||
* **Exact**: Show options that are a 100% match with the entered value. | ||||||
|
||||||
::::{tip} | ||||||
:::{tip} | ||||||
The search is not case sensitive. For example, searching for `ios` would still retrieve `iOS` if that value exists. | ||||||
:::: | ||||||
::: | ||||||
|
||||||
* **Ignore timeout for results** delays the display of the list of values to when it is fully loaded. This option is useful for large data sets, to avoid missing some available options in case they take longer to load and appear when using the control. | ||||||
|
||||||
|
@@ -72,23 +114,100 @@ To add interactive Options list and Range slider controls, create the controls, | |||||
8. Select **Save and close**. The control can now be used. | ||||||
9. Consider the position of the control if you have several controls active on the dashboard. Controls are applied from left to right, which can change the options available depending on their position when the [Chain controls](#configure-controls-settings) setting is enabled. | ||||||
10. Save the dashboard. | ||||||
|
||||||
:::: | ||||||
::::: | ||||||
|
||||||
## Add time slider controls [add-time-slider-controls] | ||||||
|
||||||
:::::{applies-switch} | ||||||
::::{applies-item} stack: ga 9.2 | ||||||
You can add one interactive time slider control to a dashboard. | ||||||
|
||||||
1. Open or create a new dashboard. | ||||||
2. In **Edit** mode, select **Add** > **Controls** > **Time slider control**. | ||||||
3. The time slider control uses the time range from the global time filter. To change the time range in the time slider control, [change the global time filter](../query-filter/filtering.md). | ||||||
4. Save the dashboard. The control can now be used. | ||||||
:::: | ||||||
::::{applies-item} stack: ga 9.0 | ||||||
You can add one interactive time slider control to a dashboard. | ||||||
|
||||||
1. Open or create a new dashboard. | ||||||
2. In **Edit** mode, select **Controls** > **Add time slider control**. | ||||||
3. The time slider control uses the time range from the global time filter. To change the time range in the time slider control, [change the global time filter](../query-filter/filtering.md). | ||||||
4. Save the dashboard. The control can now be used. | ||||||
:::: | ||||||
::::: | ||||||
|
||||||
## Add {{esql}} or variable controls [add-esql-control] | ||||||
|
||||||
:::::{applies-switch} | ||||||
::::{applies-item} stack: ga 9.2 | ||||||
You can bind controls to your {{esql}} visualizations in dashboards. When creating an {{esql}} visualization, the autocomplete suggestions prompt control insertion for field values, field names, function configuration, and function names. Variable controls act as variables in your {{esql}} visualization queries. | ||||||
|
||||||
This enables controls that only apply to specific panels in your dashboards, and exposes visualization configuration such as date histogram interval controls to dashboard users. | ||||||
|
||||||
:::{note} | ||||||
Only **Options lists** are supported for variable controls. Options can be: | ||||||
- values or fields that can be static or defined by a query | ||||||
- functions {applies_to}`stack: ga 9.1` | ||||||
::: | ||||||
|
||||||
1. Use one of the following options to start creating a variable control: | ||||||
- In **Edit** mode, select **Add** > **Controls** > **Variable control** in the toolbar. | ||||||
- On the **Create variable control** flyout, while editing your {{esql}} visualization's query, the autocomplete menu suggests adding a control when relevant or when typing `?` in the query. | ||||||
|
||||||
 | ||||||
|
||||||
2. A menu opens to let you configure the control. This is where you can specify: | ||||||
|
||||||
* The type of the control. | ||||||
* For controls with **Static values**, you select the options available in the controls by entering them manually or by using a dropdown listing available values. | ||||||
* For controls with **Values from a query**, you 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. | ||||||
* Start the name with `?` if you want the options to be simple static values. | ||||||
* Start the name with `??` if you want the options of the control to be fields or functions. {applies_to}`stack: ga 9.1` | ||||||
* Values available to select for users with 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 for users viewing the dashboard for that control. | ||||||
* The width of the control. | ||||||
|
||||||
 | ||||||
|
||||||
3. Save the control. | ||||||
|
||||||
## Add {{esql}} controls [add-esql-control] | ||||||
```{applies_to} | ||||||
stack: preview 9.0 | ||||||
serverless: preview | ||||||
``` | ||||||
The panel closes and the control is added to the dashboard. | ||||||
If you added it by starting from a query, the control is directly inserted in that query and you can continue editing it. | ||||||
|
||||||
You can then insert it in any other {{esql}} visualization queries by typing the control's name. | ||||||
|
||||||
**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 | ||||||
``` | ||||||
|
||||||
 | ||||||
:::: | ||||||
::::{applies-item} {stack: ga 9.0, serverless: preview} | ||||||
|
||||||
You can bind controls to your {{esql}} visualizations in dashboards. When creating an {{esql}} visualization, the autocomplete suggestions prompt control insertion for field values, field names, function configuration, and function names. {{esql}} controls act as variables in your {{esql}} visualization queries. | ||||||
|
||||||
|
@@ -127,7 +246,6 @@ If you added it by starting from a query, the control is directly inserted in th | |||||
|
||||||
You can then insert it in any other {{esql}} visualization queries by typing the control's name. | ||||||
|
||||||
|
||||||
**Examples** | ||||||
|
||||||
* Integrate filtering into your {{esql}} experience | ||||||
|
@@ -155,10 +273,34 @@ You can then insert it in any other {{esql}} visualization queries by typing the | |||||
``` | ||||||
|
||||||
 | ||||||
|
||||||
:::: | ||||||
::::: | ||||||
|
||||||
## Configure the controls settings [configure-controls-settings] | ||||||
:::::{applies-switch} | ||||||
::::{applies-item} stack: ga 9.2 | ||||||
Several settings that apply to all controls of the same dashboard are available. | ||||||
|
||||||
1. In **Edit** mode, select **Add** > **Controls** > **Settings** in the toolbar.. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
2. On the **Control settings** flyout, configure the following settings: | ||||||
|
||||||
* **Label position** — Specify where the control label appears. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe : here since the next bullet uses it too? |
||||||
* **Filtering** settings: | ||||||
|
||||||
* **Apply global filters to controls** — Define whether controls should ignore or apply any filter specified in the main filter bar of the dashboard. | ||||||
* **Apply global time range to controls** — Define whether controls should ignore or apply the main time range specified for the dashboard. Note that [time slider controls](#add-time-slider-controls) rely on the global time range and don’t work properly when this option is disabled. | ||||||
|
||||||
* **Selections** settings: | ||||||
|
||||||
* **Validate user selections** — When selected, any selected option that results in no data is ignored. | ||||||
* **Chain controls** — When selected, controls are applied sequentially from left to right, and line by line. Any selected options in one control narrows the available options in the next control. | ||||||
* **Apply selections automatically** — The dashboard is updated dynamically when options are selected in controls. When this option is disabled, users first need to **Apply** their control selection before they are applied to the dashboard. | ||||||
|
||||||
* To remove all controls from the dashboard, select **Delete all**. | ||||||
|
||||||
3. Select **Save** to apply the changes. | ||||||
:::: | ||||||
::::{applies-item} stack: ga 9.0 | ||||||
Several settings that apply to all controls of the same dashboard are available. | ||||||
|
||||||
1. In **Edit** mode, select **Controls** > **Settings**. | ||||||
|
@@ -179,18 +321,38 @@ Several settings that apply to all controls of the same dashboard are available. | |||||
* To remove all controls from the dashboard, select **Delete all**. | ||||||
|
||||||
3. Select **Save and close** to apply the changes. | ||||||
|
||||||
:::: | ||||||
::::: | ||||||
|
||||||
## Edit Options list and Range slider control settings [edit-controls] | ||||||
:::::{applies-switch} | ||||||
::::{applies-item} stack: ga 9.2 | ||||||
Change the settings for Options list and Range slider controls. | ||||||
|
||||||
1. Hover over the control you want to edit, then select . | ||||||
2. In the **Edit control** flyout, change the options, then select **Save**. | ||||||
:::: | ||||||
::::{applies-item} stack: ga 9.0 | ||||||
Change the settings for Options list and Range slider controls. | ||||||
|
||||||
1. Hover over the control you want to edit, then select . | ||||||
2. In the **Edit control** flyout, change the options, then select **Save and close**. | ||||||
|
||||||
:::: | ||||||
::::: | ||||||
|
||||||
## Delete controls [remove-controls] | ||||||
:::::{applies-switch} | ||||||
::::{applies-item} stack: ga 9.2 | ||||||
Delete controls from your dashboard. | ||||||
|
||||||
1. Hover over the control you want to delete, then select . | ||||||
2. In the **Delete control?** window, select **Delete**. | ||||||
|
||||||
:::{note} | ||||||
If you delete a variable control that's used in an {{esql}} visualization, the visualization will break. You must edit the visualization query and remove or update the control reference. | ||||||
::: | ||||||
:::: | ||||||
::::{applies-item} stack: ga 9.0 | ||||||
Delete controls from your dashboard. | ||||||
|
||||||
1. Hover over the control you want to delete, then select . | ||||||
|
@@ -199,3 +361,9 @@ Delete controls from your dashboard. | |||||
:::{note} | ||||||
If you delete an {{esql}} control that's used in an {{esql}} visualization, the visualization will break. You must edit the visualization query and remove or update the control reference. | ||||||
::: | ||||||
|
||||||
:::: | ||||||
::::: | ||||||
|
||||||
|
||||||
|
Binary file modified
BIN
-14.9 KB
(87%)
explore-analyze/images/esql-visualization-control-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-126 KB
(79%)
explore-analyze/images/esql-visualization-control-suggestion.png
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.