Recipes - Vector and Fluent Bit

Shipper configurations for the NDJSON route. Untested against a running gate.

On this page

All values are synthetic. See the Ingest overview for the gate contract.

Vector to /v1/logs#

NDJSON is the gate's native shape, so this has the fewest unknowns.

toml
[transforms.shape]
type = "remap"
inputs = ["app_logs"]
source = '''
.ts      = to_unix_timestamp!(.timestamp, unit: "milliseconds")
.level   = string(.level) ?? "info"
.service = "app1"
.host    = get_hostname!()
.msg     = string!(.message)
.attrs   = {}
del(.timestamp)
del(.message)
'''

[sinks.drillo]
type = "http"
inputs = ["shape"]
uri = "http://gate.internal:4318/v1/logs"
method = "post"
compression = "none"
encoding.codec = "json"
framing.method = "newline_delimited"
auth.strategy = "bearer"
auth.token = "${DRILLO_TOKEN}"
request.headers.X-Drillo-Stream = "vector-app1"
request.retry_attempts = 1000000
buffer.type = "disk"
buffer.max_size = 1073741824
buffer.when_full = "block"
  • Do not use Vector's opentelemetry sink or encoding.codec = "otlp".
  • Unverified: whether the sink sends Content-Length or chunked for this config. If it chunks, confirm the gate accepts it in your setup.
  • Run vector validate first. VRL signatures differ between versions.

Fluent Bit http output#

ini
[FILTER]
    Name    modify
    Match   *
    Rename  log      msg
    Add     service  app1
    Add     host     ${HOSTNAME}
    Add     level    info

[OUTPUT]
    Name             http
    Match            *
    Host             gate.internal
    Port             4318
    Uri              /v1/logs
    Format           json_lines
    Json_date_key    ts
    Json_date_format epoch_ms
    Header           Authorization Bearer ${DRILLO_TOKEN}
    Header           X-Drillo-Stream fluentbit-app1
    tls              off
    Retry_Limit      no_limits
  • Json_date_format epoch is seconds. Do not use it.
  • compress gzip is accepted. Never use zstd or snappy here.
  • Rename assumes your record key is log. Adjust it.

Report an inaccuracy (opens a support ticket in the portal; nothing is sent from this page)