Command line interface to follow incremental log files, filter lines and send to the remote-logger server.
Note
|
under development |
usage: Send your logs to remote endpoints [-h] -f FILTER [-c CONFIG]
[-sh HOST] [-u USER] [-p PASSWD]
[-e EXCHANGE] [-rk ROUTING_KEY]
[-q QUEUE] [-sp PORT]
[-et EXCHANGE_TYPE] [-hb HEARTBEAT]
[-bct BLOCKED_CONNECTION_TIMEOUT]
$ # Using a configuration file:
$ remotelogger-cli.py --filter test/filter.yaml --config test/config.yaml
$ # Using command line arguments:
$ remotelogger-cli.py --filter test/filter.yaml -sh localhost -u guest -p guest -e exchange -rk routing_key -q queue
The Config file is an alternative way to provide connection configuration parameters instead of passing them as command line arguments.
Configuration file is in YAML format
{
"host": "localhost",
"port": 5672,
"user": "guest",
"pass": "guest",
"exchange": "exchange",
"exchange_type": "direct",
"routing_key": "routing_key",
"queue": "queue",
"heartbeat": 0,
"blocked_connection_timeout": 300
}
Filter file points to the log files to follow and defines filters to categorize log lines.
Filters are based on regular expressions and uses re library to match patterns.
Once a log line is filtered, some properties can be defined per filter:
-
severity: Severity level of the message (NONE, INFO, WARNING, ERROR, SUCCESS)
-
verbosity: Verbosity level (None or 0-5)