Fluentbit x OTEL Is it possible to move the conten...
# fluent-bit
d
Fluentbit x OTEL Is it possible to move the content of a Fluent-bit "JSON" log in HEC format eg.
{event:{},fields:{}}
so that all of the fields are now part of the opentelemetry attributes/resources envelope within Fluentbit?
We're currently sending logs to Splunk which have the format eg.
Copy code
{ "event": { "Hello": "meta?", "level": "INFO", }, "host": "localhost", "fields": { "field_1": "value_1", } }
...but we'd love to be able to natively send these to an OTEL platform with the correct fields as part of the OTEL atributes/resources correctly scope into the right format
Copy code
{
  "body": "{\"Hello\":\"meta?\",\"level\":\"INFO\"}",
  "id": "0hySMFcuBVPIYVOE4CNuWFbKqC8",
  "timestamp": "2025-09-18T11:32:13.249668633Z",
  "attributes": {
    "record_meta": "ok"
  },
  "resources": {},
  "scope": {},
  "severity_text": "",
  "severity_number": 0,
  "scope_name": "",
  "scope_version": "",
  "span_id": "",
  "trace_flags": 0,
  "trace_id": ""
}
a
I believe using the OTEL envelope processor is what you want
then with the latest Fluent Bit we should be flattening the message from OTEL to Splunk HEC
Oh sorry I think I misread
going from Splunk HEC to OTEL
r
Can we use the OTEL envelope as a processor for the output or must it be for the input?
Also, the upsert example:
Copy code
- name: content_modifier
            context: otel_resource_attributes
            action: upsert
            key: service.name
            value: my-service
looks like it only works for static values - we can't use
$fields['field_1']
I think I got it working by using:
logs_body_key_attributes
but that's actually missing from the official logs: https://docs.fluentbit.io/manual/data-pipeline/outputs/opentelemetry