Open aofodo opened 5 months ago
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
@aofodo we use Go's built-in package for regex which I don't believe supports PCRE2
regexes by design. We'd need to find a suitable library to implement this feature request.
We are trying to remove the .
from the k8sattributes for k8s labels. For Eg k8s.pods.labels.service.version=1
to k8s.pods.labels.service_version=1
. We require some advanced regex like PCRE2 to perform these operations.
@amal-v can you share the PCRE2 regex you'd like to use for your use case?
Ditto this. I have a use case where a span attribute is a JSON string and I need to obfuscate the JSON values with the exception of some that correspond to a specific JSON key. Doesn't seem possible without a negative lookbehind.
for reference
transform:
error_mode: ignore
trace_statements:
- context: span
statements:
- "replace_pattern(attributes[\"my-attribute\"], \"(?<!\\\"(key1|key2)\\\": )\\\"[^\\\"]+\\\"\", \"?\")"
There's probably a way to do this by transforming across multiple transformation stages but a single regex solution is much preferable.
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.
Negative lookahead isn't supported by Go's regexp package, so we'd need another regular expression package that does.
I haven't had a chance to work with it, but this package go.arsenm.dev/pcre looks good. But it has limitations in target os and arch
But it has limitations in target os and arch
That will be a dealbreaker as OTTL needs to work in all the target architectures supported by https://github.com/open-telemetry/opentelemetry-collector-releases
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers
. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself.
Component(s)
processor/transform
Is your feature request related to a problem? Please describe.
I need to mask PANs (card numbers) in logs. Card numbers can be in different versions. With different dividers, different lengths. It is important that other data is not accidentally masked. To do this, I use a complex regular expression, including lookahead and other features of the PCRE2 syntax. Without the syntax capabilities of PCRE2, it is impossible to fully mask card numbers
Describe the solution you'd like
Add support PCRE2 syntax in
processor/transform
forreplace_pattern
andreplace_all_patterns
Describe alternatives you've considered
No response
Additional context
No response