Comments (5)
The code owners for pkg/ottl
will have better insight than me here, but at a glance, the regex
and replacement
arguments in the replace_pattern
function call need to be enclosed in double quotes as they're strings.
The following works for me:
- replace_pattern(attributes["Body"], "(?U)name\":\"(.*)\"", "name\":\"**********\"")
from opentelemetry-collector-contrib.
Pinging code owners:
- pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
See Adding Labels via Comments if you do not have permissions to add labels yourself.
from opentelemetry-collector-contrib.
(?U)name\":\"(.*)\", name\":\"**********\",
should become "(?U)name\":\"(.*)\", name\":\"**********\","
from opentelemetry-collector-contrib.
Doing so, the Collector fails with error:
2024-06-17T08:02:14.204Z warn [email protected]/expand.go:73 Variable substitution using $VAR will be deprecated in favor of ${VAR} and ${env:VAR}, please update $$ {"variable": "$"}
Error: invalid configuration: processors::transform/avg: unable to parse OTTL statement "replace_pattern(attributes[\"Body\"], \"(?U)name\\\":\\\"(.*)\\\", \"name\\\":\\\"**********\\\")": statement has invalid syntax: 1:64: invalid input text "\\\":\\\"**********\\..."
2024/06/17 08:02:14 collector server run finished with error: invalid configuration: processors::transform/avg: unable to parse OTTL statement "replace_pattern(attributes[\"Body\"], \"(?U)name\\\":\\\"(.*)\\\", \"name\\\":\\\"**********\\\")": statement has invalid syntax: 1:64: invalid input text "\\\":\\\"**********\\..."
from opentelemetry-collector-contrib.
You'll need to escape *
as well: replace_pattern(attributes["Body"], "(?U)name\":\"(.*)\", name\":\"\*\*\*\*\*\*\*\*\*\*\",")
.
I suggest testing that your regex is well formatted and then adding it to your config.
from opentelemetry-collector-contrib.
Related Issues (20)
- [receiver/vcenter] Could use VSAN metrics for vCenter HOT 1
- [receiver/dockerstatsreceiver] Does not support setting TLS settings HOT 1
- [receiver/sqlserver] Allow server config option to include port HOT 3
- need k8s.pod.memory.working_set_memory_limit_utilization metric HOT 1
- [exporter/datadog] collector panics on invalid trace & span ids in logs HOT 5
- Create internal/arrow package for common code used in otelarrowexporter, otelarrowreceiver HOT 5
- Tail sampling processor: add a way to sample all spans that have a span link to a sampled span. HOT 2
- [extension/observer] Expose host and port separately in endpoint env HOT 1
- Migrate otel metrics to use mdatagen: deltatocumulative processor HOT 3
- [cmd/opampsupervisor] Forward Custom Messages to/from agent HOT 1
- [testbed/mockdatasenders/mockdatadogagentexporter] Broken load test HOT 1
- openid authorization support (otel extension) for opamp supervisor HOT 2
- Migrate from `otelcoltest.LoadConfigAndValidate` to `otelcoltest.LoadConfigAndValidateWithSettings` HOT 2
- make update-otel shouldn't update the toolchain HOT 1
- `go generate` fails with `mdatagen` error HOT 3
- [receiver/vcenter] Additional metrics for vCenter receiver HOT 2
- New component: cfgardenobserver HOT 2
- [kafkareceiver] add support for otlp_json which accepts json formated for Otel Collector kafka receiver HOT 3
- Span Metrics connector support for OTEP 235 probability sampling HOT 1
- ClickHouse exporter produces duplicates and poor compression without sorting attributes HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentelemetry-collector-contrib.