lbcli create logs sources

AI Tools

Creates a new log source.

Synopsis

Creates a new log source. Exactly one of --journald-id or --file-paths must be provided to specify the collection mechanism.

Log format is inferred automatically when --journald-id is used (defaults to ZAP_JSON for most Lightbits services). For file sources, you can set it explicitly with --log-format.

Supported log formats: zap-json, logfmt, duroslight-text, gftl-text, unstructured.

Supported min levels: debug, info, warn, error.

lbcli create logs sources [flags]

Examples

# Create a journald source for the node-manager service lbcli -J $JWT create logs sources \ --name=node-manager \ --journald-id=node-manager \ --enabled \ --min-level=info # Create a file source that watches a log file, tagging it with metadata lbcli -J $JWT create logs sources \ --name=custom-app \ --file-paths=/var/log/custom-app.log \ --log-format=zap-json \ --label=app=custom-app \ --label=env=prod # Create a disabled source (enable it later with "update") lbcli -J $JWT create logs sources \ --name=api-service \ --journald-id=api-service

Flag

Short

Type

Default

Description

--help

-h

bool


Help for source.

--enabled


bool

true

Enable this source immediately (default: true).

--file-paths


stringSlice


Comma-separated list of file glob patterns for file-based collection; e.g. /var/log/app.log,/var/log/app-*.log.

--journald-id


string


Journald syslog identifier (unit name) to collect from; e.g., node-manager.

--label


stringArray


Label to attach to log entries, in key=value format (repeatable, file sources only).

--log-format


string


Log format hint: zap-json, logfmt, duroslight-text, gftl-text, unstructured (auto-detected when empty).

--min-level


string


Minimum log severity to forward: debug, info, warn, error (default: all).

--name


string


Name of the log source (required).