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/app/java-standalone-telemetry-processors-examples.md
+33-22Lines changed: 33 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -355,9 +355,12 @@ For example, given `http.url = http://example.com/path?queryParam1=value1,queryP
355
355
}
356
356
```
357
357
358
-
The following sample shows how to process spans that have a span name that matches regex patterns.
359
-
This processor removes the `token` attribute. It obfuscates the `password` attribute in spans where the span name matches `auth.*`
360
-
and where the span name doesn't match `login.*`.
358
+
### Mask
359
+
360
+
For example, given `http.url = https://example.com/user/12345622` is updated to `http.url = https://example.com/user/****` using either of the below configurations.
361
+
362
+
363
+
First configuration example:
361
364
362
365
```json
363
366
{
@@ -366,27 +369,12 @@ and where the span name doesn't match `login.*`.
366
369
"processors": [
367
370
{
368
371
"type": "attribute",
369
-
"include": {
370
-
"matchType": "regexp",
371
-
"spanNames": [
372
-
"auth.*"
373
-
]
374
-
},
375
-
"exclude": {
376
-
"matchType": "regexp",
377
-
"spanNames": [
378
-
"login.*"
379
-
]
380
-
},
381
372
"actions": [
382
373
{
383
-
"key": "password",
384
-
"value": "obfuscated",
385
-
"action": "update"
386
-
},
387
-
{
388
-
"key": "token",
389
-
"action": "delete"
374
+
"key": "http.url",
375
+
"pattern": "user\\/\\d+",
376
+
"replace": "user\\/****",
377
+
"action": "mask"
390
378
}
391
379
]
392
380
}
@@ -396,6 +384,29 @@ and where the span name doesn't match `login.*`.
396
384
```
397
385
398
386
387
+
Second configuration example with regular expression group name:
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/java-standalone-telemetry-processors.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ ms.reviewer: mmcc
15
15
16
16
Application Insights Java 3.x can process telemetry data before the data is exported.
17
17
18
-
Here are some use cases for telemetry processors:
18
+
Some use cases:
19
19
* Mask sensitive data.
20
20
* Conditionally add custom dimensions.
21
21
* Update the span name, which is used to aggregate similar telemetry in the Azure portal.
@@ -52,7 +52,11 @@ The trace message or body is the primary display for logs in the Azure portal. L
52
52
53
53
## Telemetry processor types
54
54
55
-
Currently, the four types of telemetry processors are attribute processors, span processors, log processors, and metric filters.
55
+
Currently, the four types of telemetry processors are
56
+
* Attribute processors
57
+
* Span processors
58
+
* Log processors
59
+
* Metric filters
56
60
57
61
An attribute processor can insert, update, delete, or hash attributes of a telemetry item (`span` or `log`).
58
62
It can also use a regular expression to extract one or more new attributes from an existing attribute.
@@ -111,6 +115,7 @@ The attribute processor modifies attributes of a `span` or a `log`. It can suppo
111
115
-`delete`
112
116
-`hash`
113
117
-`extract`
118
+
-`mask`
114
119
115
120
### `insert`
116
121
@@ -227,6 +232,38 @@ The `extract` action requires the following settings:
227
232
*`pattern`
228
233
*`action`: `extract`
229
234
235
+
### `mask`
236
+
237
+
> [!NOTE]
238
+
> The `mask` feature is available only in version 3.2.5 and later.
239
+
240
+
The `mask` action masks attribute values by using a regular expression rule specified in the `pattern` and `replace`.
241
+
242
+
```json
243
+
"processors": [
244
+
{
245
+
"type": "attribute",
246
+
"actions": [
247
+
{
248
+
"key": "attributeName",
249
+
"pattern": "<regular expression pattern>",
250
+
"replace": "<replacement value>",
251
+
"action": "mask"
252
+
}
253
+
]
254
+
}
255
+
]
256
+
```
257
+
The `mask` action requires the following settings:
258
+
*`key`
259
+
*`pattern`
260
+
*`replace`
261
+
*`action`: `mask`
262
+
263
+
`pattern` can contain a named group placed betwen `?<` and `>:`. Example: `(?<userGroupName>[a-zA-Z.:\/]+)\d+`? The gorup is `(?<userGroupName>[a-zA-Z.:\/]+)` and `userGroupName` is the name of the group. `pattern` can then contain the same named group placed between `${` and `}` followed by the masK. Example where the mask is **: `${userGroupName}**`.
264
+
265
+
See [Telemetry processor examples](./java-standalone-telemetry-processors-examples.md) for masking examples.
266
+
230
267
### Include criteria and exclude criteria
231
268
232
269
Attribute processors support optional `include` and `exclude` criteria.
0 commit comments