From 0f8e1282b5cc7b8c1639d3117db36a5d31a3cccd Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Mon, 12 Jun 2023 08:45:16 -0600 Subject: [PATCH] [pkg/ottl] Update docs of functions impacted by grammar bug (#23259) Update readme --- pkg/ottl/ottlfuncs/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkg/ottl/ottlfuncs/README.md b/pkg/ottl/ottlfuncs/README.md index 5eaf11ff0a10..e63d09fe7cc2 100644 --- a/pkg/ottl/ottlfuncs/README.md +++ b/pkg/ottl/ottlfuncs/README.md @@ -152,6 +152,9 @@ The `replace_all_matches` function replaces any matching string value with the r Each string value in `target` that matches `pattern` will get replaced with `replacement`. Non-string values are ignored. +There is currently a bug with OTTL that does not allow the pattern to end with `\\"`. +[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238). + Examples: - `replace_all_matches(attributes, "/user/*/list/*", "/user/{userId}/list/{listId}")` @@ -170,6 +173,10 @@ If one or more sections of `target` match `regex` they will get replaced with `r The `replacement` string can refer to matched groups using [regexp.Expand syntax](https://pkg.go.dev/regexp#Regexp.Expand). +There is currently a bug with OTTL that does not allow the pattern to end with `\\"`. +If your pattern needs to end with backslashes, add something inconsequential to the end of the pattern such as `{1}`, `$`, or `.*`. +[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238). + Examples: - `replace_all_patterns(attributes, "value", "/account/\\d{4}", "/account/{accountId}")` @@ -190,6 +197,9 @@ The `replace_match` function allows replacing entire strings if they match a glo If `target` matches `pattern` it will get replaced with `replacement`. +There is currently a bug with OTTL that does not allow the pattern to end with `\\"`. +[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238). + Examples: - `replace_match(attributes["http.target"], "/user/*/list/*", "/user/{userId}/list/{listId}")` @@ -206,6 +216,10 @@ If one or more sections of `target` match `regex` they will get replaced with `r The `replacement` string can refer to matched groups using [regexp.Expand syntax](https://pkg.go.dev/regexp#Regexp.Expand). +There is currently a bug with OTTL that does not allow the pattern to end with `\\"`. +If your pattern needs to end with backslashes, add something inconsequential to the end of the pattern such as `{1}`, `$`, or `.*`. +[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238). + Examples: - `replace_pattern(resource.attributes["process.command_line"], "password\\=[^\\s]*(\\s?)", "password=***")` @@ -401,6 +415,9 @@ If target is not a string, it will be converted to one: If target is nil, false is always returned. +There is currently a bug with OTTL that does not allow the target string to end with `\\"`. +[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238). + Examples: - `IsMatch(attributes["http.path"], "foo")` @@ -545,6 +562,9 @@ The `Split` Converter separates a string by the delimiter, and returns an array If the `target` is not a string or does not exist, the `Split` Converter will return an error. +There is currently a bug with OTTL that does not allow the target string to end with `\\"`. +[See Issue 23238 for details](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23238). + Examples: - ```Split("A|B|C", "|")```