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
[pkg/ottl] Changed replacement string to be a path expression to a string telemetry field or a literal string (open-telemetry#23210)
* [pkg/ottl] Changed replacement string to be a path expression to a string telemetry field or a literal string
* [pkg/ottl] Changed replacement string (replace_all* functions) to be a path expression to a string telemetry field or a literal string
Copy file name to clipboardExpand all lines: pkg/ottl/ottlfuncs/README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ Examples:
148
148
149
149
The `replace_all_matches` function replaces any matching string value with the replacement string.
150
150
151
-
`target` is a path expression to a `pdata.Map` type field. `pattern` is a string following [filepath.Match syntax](https://pkg.go.dev/path/filepath#Match). `replacement` is a string.
151
+
`target` is a path expression to a `pdata.Map` type field. `pattern` is a string following [filepath.Match syntax](https://pkg.go.dev/path/filepath#Match). `replacement` is either a path expression to a string telemetry field or a literal string.
152
152
153
153
Each string value in `target` that matches `pattern` will get replaced with `replacement`. Non-string values are ignored.
154
154
@@ -162,7 +162,7 @@ Examples:
162
162
163
163
The `replace_all_patterns` function replaces any segments in a string value or key that match the regex pattern with the replacement string.
164
164
165
-
`target` is a path expression to a `pdata.Map` type field. `regex` is a regex string indicating a segment to replace. `replacement` is a string.
165
+
`target` is a path expression to a `pdata.Map` type field. `regex` is a regex string indicating a segment to replace. `replacement` is either a path expression to a string telemetry field or a literal string.
166
166
167
167
`mode` determines whether the match and replace will occur on the map's value or key. Valid values are `key` and `value`.
168
168
@@ -186,7 +186,7 @@ If using OTTL outside of collector configuration, `$` should not be escaped and
186
186
187
187
The `replace_match` function allows replacing entire strings if they match a glob pattern.
188
188
189
-
`target` is a path expression to a telemetry field. `pattern` is a string following [filepath.Match syntax](https://pkg.go.dev/path/filepath#Match). `replacement` is a string.
189
+
`target` is a path expression to a telemetry field. `pattern` is a string following [filepath.Match syntax](https://pkg.go.dev/path/filepath#Match). `replacement` is either a path expression to a string telemetry field or a literal string.
190
190
191
191
If `target` matches `pattern` it will get replaced with `replacement`.
192
192
@@ -200,7 +200,7 @@ Examples:
200
200
201
201
The `replace_pattern` function allows replacing all string sections that match a regex pattern with a new value.
202
202
203
-
`target` is a path expression to a telemetry field. `regex` is a regex string indicating a segment to replace. `replacement` is a string.
203
+
`target` is a path expression to a telemetry field. `regex` is a regex string indicating a segment to replace. `replacement` is either a path expression to a string telemetry field or a literal string.
204
204
205
205
If one or more sections of `target` match `regex` they will get replaced with `replacement`.
0 commit comments