Sage
Docs / Reference

Configuration

Sage reads its configuration from /etc/sage/sage.toml. Pass --config to use another file. The file is TOML; every option has a default, so it only needs what you change.

A complete example

# /etc/sage/sage.toml

[inputs]
files = ["/var/log/nginx/*.log", "/var/log/app/*.log"]
journald = true

[parse]
format = "json"

[outputs.http]
url = "https://logs.example.com/ingest"

[buffer]
max_size = "1GiB"

Environment variables

Every option can also be set in the environment: write the key in upper case, replace dots with underscores and put SAGE_ in front, so inputs.files becomes SAGE_INPUTS_FILES. The environment wins over the file.

Options

OptionTypeDefaultDescription
inputs.fileslist[]Glob patterns of files to tail.
inputs.journaldboolfalseRead the systemd journal.
inputs.start_atstringendWhere to begin with a file never seen before: beginning or end.
parse.formatstringautojson, logfmt, regex or auto, which tries JSON and logfmt.
parse.patternstring–Regular expression with named groups, used when the format is regex.
outputs.http.urlstring–Endpoint to POST batches of events to.
outputs.http.batch_sizeint500Events per request.
outputs.http.compressbooltrueCompress requests with gzip.
outputs.file.pathstring–Write events to this file as JSON lines.
buffer.pathstring/var/lib/sage/bufferFolder of the disk buffer.
buffer.max_sizestring256MiBLargest size the buffer may grow to before the oldest events are dropped.
flush_intervalduration1sLongest time an event waits before its batch is sent.
labelsmap{}Fields added to every event, such as the environment or the host role.
log.levelstringinfodebug, info, warn or error.