CLI reference
All commands take the global flags below. sage help COMMAND shows the same information in the terminal.
Global flags
| Flag | Description |
|---|---|
--config FILE | Configuration file. Default: /etc/sage/sage.toml. |
--log-level LEVEL | debug, info, warn or error. |
-h, --help | Show help for a command. |
-v, --version | Print 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]
| Flag | Default | Description |
|---|---|---|
--once | false | Read 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
| Flag | Default | Description |
|---|---|---|
--raw | false | Print the lines as read, before parsing. |
--lines N | 10 | Start 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
| Flag | Default | Description |
|---|---|---|
--input NAME | – | Treat the file as part of this input. |
sage positions
Show how far each input has been read.
sage positions [flags]
| Flag | Default | Description |
|---|---|---|
--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