You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/visualize/workbooks-text.md
+52-13Lines changed: 52 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,36 +2,59 @@
2
2
title: Azure Monitor workbooks text parameters
3
3
description: Simplify complex reporting with prebuilt and custom parameterized workbooks. Learn more about workbook text parameters.
4
4
services: azure-monitor
5
-
manager: carmonm
6
5
7
6
ms.workload: tbd
8
7
ms.tgt_pltfrm: ibiza
9
8
ms.topic: conceptual
10
-
ms.date: 10/23/2019
9
+
ms.date: 07/02/2021
11
10
---
12
11
13
12
# Workbook text parameters
14
13
15
-
Textbox parameters provide a simple way to collect text input from workbook users. They are used when it is not practical to use a drop-down to collect the input (for example, an arbitrary threshold or generic filters). Workbooks allow authors to get the default value of the textbox from a query. This allows interesting scenarios like setting the default threshold based on the p95 of the metric.
14
+
Textbox parameters provide a simple way to collect text input from workbook users. They're used when it isn't practical to use a drop-down to collect the input (for example, an arbitrary threshold or generic filters). Workbooks allow authors to get the default value of the textbox from a query. This allows interesting scenarios like setting the default threshold based on the p95 of the metric.
16
15
17
-
A common use of textboxes is as internal variables used by other workbook controls. This is done by leveraging a query for default values, and making the input control invisible in read-mode. For example, a user may want a threshold to come from a formula (not a user) and then use the threshold in subsequent queries.
16
+
A common use of textboxes is as internal variables used by other workbook controls. This is done by using a query for default values, and making the input control invisible in read-mode. For example, a user may want a threshold to come from a formula (not a user) and then use the threshold in subsequent queries.
18
17
19
18
## Creating a text parameter
20
19
1. Start with an empty workbook in edit mode.
21
20
2. Choose _Add parameters_ from the links within the workbook.
22
-
3.Click on the blue _Add Parameter_ button.
21
+
3.Select on the blue _Add Parameter_ button.
23
22
4. In the new parameter pane that pops up enter:
24
23
1. Parameter name: `SlowRequestThreshold`
25
24
2. Parameter type: `Text`
26
25
3. Required: `checked`
27
-
4. Get default value from query: `unchecked`
26
+
4. Get data from: `None`
28
27
5. Choose 'Save' from the toolbar to create the parameter.
29
28
30
-

29
+
:::image type="content" source="./media/workbooks-text/text-create.png" alt-text="Screenshot showing the creation of a text parameter.":::
31
30
32
31
This is how the workbook will look like in read-mode.
33
32
34
-

33
+
:::image type="content" source="./media/workbooks-text/text-readmode.png" alt-text="Screenshot showing a text parameter in read mode." border="false":::
34
+
35
+
## Parameter field style
36
+
Text parameter supports following field style:
37
+
38
+
- Standard: A single line text field.
39
+
40
+
:::image type="content" source="./media/workbooks-text/standard-text.png" alt-text="Screenshot showing standard text field.":::
41
+
42
+
- Password: A single line password field. The password value is only hidden on UI when user types. The value is still fully accessible as a param value when referred and it's stored unencrypted when workbook is saved.
- Multiline: A multiline text field with support of rich intellisense and syntax colorization for following languages:
47
+
- Text
48
+
- Markdown
49
+
- JSON
50
+
- SQL
51
+
- TypeScript
52
+
- KQL
53
+
- TOML
54
+
55
+
User can also specify the height for the multiline editor.
56
+
57
+
:::image type="content" source="./media/workbooks-text/kql-text.png" alt-text="Screenshot showing multiline text field.":::
35
58
36
59
## Referencing a text parameter
37
60
1. Add a query control to the workbook by selecting the blue `Add query` link and select an Application Insights resource.
@@ -51,20 +74,20 @@ This is how the workbook will look like in read-mode.
51
74
```
52
75
4. Run query to see the results
53
76
54
-

77
+
:::image type="content" source="./media/workbooks-text/text-reference.png" alt-text="Screenshot showing a text parameter referenced in KQL.":::
55
78
56
79
> [!NOTE]
57
80
> In the example above, `{SlowRequestThreshold}` represents an integer value. If you were querying for a string like `{ComputerName}` you would need to modify your Kusto query to add quotes `"{ComputerName}"` in order for the parameter field to an accept input without quotes.
58
81
59
-
## Setting default values
82
+
## Setting default values using queries
60
83
1. Start with an empty workbook in edit mode.
61
84
2. Choose _Add parameters_ from the links within the workbook.
62
-
3. Click on the blue _Add Parameter_ button.
85
+
3. Select on the blue _Add Parameter_ button.
63
86
4. In the new parameter pane that pops up enter:
64
87
1. Parameter name: `SlowRequestThreshold`
65
88
2. Parameter type: `Text`
66
89
3. Required: `checked`
67
-
4. Get default value from query: `checked`
90
+
4. Get data from: `Query`
68
91
5. In the KQL box, add this snippet:
69
92
```kusto
70
93
requests
@@ -74,11 +97,27 @@ This is how the workbook will look like in read-mode.
74
97
6. Run query to see the result
75
98
7. Choose 'Save' from the toolbar to create the parameter.
76
99
77
-

100
+
:::image type="content" source="./media/workbooks-text/text-default-value.png" alt-text="Screenshot showing a text parameter with default value from KQL.":::
78
101
79
102
> [!NOTE]
80
103
> While this example queries Application Insights data, the approach can be used for any log based data source - Log Analytics, Azure Resource Graph, etc.
81
104
105
+
## Adding validations
106
+
107
+
For standard and password text parameters, user can add validation rules that are applied to the text field. Add a valid regex with error message. If message is set, it's shown as error when field is invalid.
108
+
109
+
If match is selected, the field is valid if value matches the regex and if match isn't selected then the field is valid if it doesn't match the regex.
110
+
111
+
:::image type="content" source="./media/workbooks-text/validation-settings.png" alt-text="Screenshot of text validation settings.":::
112
+
113
+
## Format JSON data
114
+
115
+
If JSON is selected as the language for the multiline text field, then the field will have a button that will format the JSON data of the field. User can also use the shortcut `(ctrl + \)` to format the JSON data.
116
+
117
+
If data is coming from a query, user can select the option to pre-format the JSON data returned by the query.
118
+
119
+
:::image type="content" source="./media/workbooks-text/pre-format-json-data.png" alt-text="Screenshot of pre-format JSON data.":::
120
+
82
121
## Next steps
83
122
84
123
* [Get started](./workbooks-overview.md#visualizations) learning more about workbooks many rich visualizations options.
0 commit comments