Sage
Docs / Reference

CLI reference

All commands take the global flags below. sage help COMMAND shows the same information in the terminal.

Global flags

FlagDescription
--config FILEConfiguration file. Default: /etc/sage/sage.toml.
--log-level LEVELdebug, info, warn or error.
-h, --helpShow help for a command.
-v, --versionPrint the version and exit.

sage run

Start collecting and shipping logs. This is what the service unit runs. It reads the configuration file, starts all inputs and outputs, and keeps running until it receives SIGTERM.

sage run [flags]
FlagDefaultDescription
--oncefalseRead what is in the inputs now, ship it and exit.

sage validate

Check the configuration file and exit. Every input, parser and output is checked as if Sage were starting, without opening any files or connections.

sage validate

sage tail

Print the events of one input as they arrive. Useful to see what a parser makes of your lines before they are shipped anywhere.

sage tail [flags] INPUT
FlagDefaultDescription
--rawfalsePrint the lines as read, before parsing.
--lines N10Start with the last N lines.

sage replay

Ship a file from the beginning. The file is read once and its lines go through the same parsers and outputs as the input they would match.

sage replay [flags] FILE
FlagDefaultDescription
--input NAME–Treat the file as part of this input.

sage positions

Show how far each input has been read.

sage positions [flags]
FlagDefaultDescription
--reset INPUT–Forget the position of an input, so it is read again from the start.

sage completion

Print a shell completion script. SHELL is bash, zsh or fish.

sage completion SHELL