-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tranform processor- expected string but got pcommon.Map #26689
Comments
Expected Result |
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@sairamsadanala in the rest of the log message it should print out the exact statement that is failing, can you include that? Also, if you want to save a statement, instead of using
|
26:00.268Z warn ottl@v0.82.0/parser.go:211 failed to execute statement {"kind": "processor", "name": "transform", "pipeline": "logs", "error": "expected string but got pcommon.Map", "statement": "set(attributes["cache"], ParseJSON(body)) where IsMatch(body, "^\\{")"} |
Something is wrong with this section of your condition: |
Thanks @TylerHelmuth. I was trying different functions and might have given you wrong one. body.string function converted map to string which solved my problem. |
Component(s)
processor/transform
What happened?
Description
Fluent Bit is sending logs to otelcol-contrib otlphttp receiver and otelcol-contrib extract kubernetes.namespace_name value using Transform processor and set loki.tenant hint so that loki exporter sends logs to loki endpoint.
Steps to Reproduce
Expected Result
it should set loki.tenant =mytenant
Actual Result
Collector version
0.82
Environment information
Environment
OS: AWS EKS
OpenTelemetry Collector configuration
Log output
Additional context
Below telemetry is being exported from Fluent Bit to Otelcol-contrib and then sending to loki endpoint.
ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2023-09-14 15:54:35.813509554 +0000 UTC
SeverityText:
SeverityNumber: Unspecified(0)
Body: Map({"@timestamp":"2023-09-14T15:54:35.813509554+00:00","cluster":"XXX","kubernetes":{"annotations":{"XXX-linux"},"container_hash":"XX","container_image":"XX","container_name":"XX","docker_id":"XXX","host":"XX","labels":{"app":"XX","controller-revision-hash":"XX","pod-template-generation":"XX"},"namespace_name":"mynamespace","pod_id":"XX","pod_name":"XX"},"logtag":"X","message":"time="2XX" level=debug msg="XX" Duration="XX" Method=GET RequestURL=/readiness Route=ReadinessProbe StatusCode=200 logLayer=rest_frontend requestID=XX requestSource=REST workflow="trident_rest=logger"","stream":"stderr"})
Attributes:
-> loki.tenant: Str(loki_tenant)
Trace ID:
Span ID:
Flags: 0
{"kind": "exporter", "data_type": "logs", "name": "logging"}
2023-09-14T15:54:37.887Z error exporterhelper/queued_retry.go:391 Exporting failed. The error is not retryable. Dropping data. {"kind": "exporter", "data_type": "logs", "name": "loki", "error":
"Permanent error: HTTP 401 "Unauthorized": no org id", "dropped_items": 4}
warn ottl@v0.82.0/parser.go:211 failed to execute statement {"kind": "processor", "name": "transform", "pipeline": "logs", "error": "expected string but got pcommon.Map",
The text was updated successfully, but these errors were encountered: