Failed to process entry {"kind": "receiver", "name": "filelog/test_parsing", "operator_id": "$.regex_parser", "operator_type": "regex_parser", "error": {"description": "set parse_to: cannot set a attribute to a non-string value"}, "action": "send", "entry": {"timestamp":"2022-02-11T09:53:33.801367178Z","body":null,"severity":0}}
Monitor the file using a filelog receiver and write data to a new file /tmp/otel_parsing.out as configured in the agent_config.yaml below. Check OTel Collector logs using journalctl -f -u splunk-otel-collector.
Description
The documentation of the log data model at https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-attributes states that the
attributes
field is a map where the keys are of typestring
and the values of typeany
. However, trying to set an attribute to a non-string value fails with error messageI think this is due to type checking in https://github.com/open-telemetry/opentelemetry-log-collection/blob/89d49a3897633119bfe20628ff10f945d9741636/entry/attribute_field.go#L44.
Setup
Steps to reproduce
Create a file
/tmp/test_parsing.log
with following content:Monitor the file using a
filelog
receiver and write data to a new file/tmp/otel_parsing.out
as configured in theagent_config.yaml
below. Check OTel Collector logs usingjournalctl -f -u splunk-otel-collector
.agent_config.yaml