opensnitch/daemon/log/loggers
Gustavo Iñiguez Goia 102b65e6c3
added new generic remote logger and new formats
- Added new generic remote logger to send events to remote servers.
- Added new formats RFC3164 and JSON.

Configuration example to send events to logstash using the tcp input
plugin, in json format:
 "Loggers": [
    {
        "Name": "remote",
        "Server": "127.0.0.1:3333",
        "Protocol": "tcp",
        "Workers": 5,
        "Format": "json",
        "Tag": "opensnitch"
    },
 ]

logstash configuration, saving events under document.*:
 input {
    tcp {
        port => 3333
        codec => json_lines {
            target => "[document]"
        }
    }
 }

You can also use the syslog input plugin:
 "Loggers": [
    {
        "Name": "remote",
        "Server": "127.0.0.1:5140",
        "Protocol": "tcp",
        "Workers": 5,
        "Format": "rfc3164",
        "Tag": "opensnitch"
    },
 ]

logstash's syslog input plugin configuration:
 input {
    syslog {
        port => 5140
    }
}

Note: you'll need a grok filter to parse and extract the fields.

See: #947
2023-05-29 13:49:38 +02:00
..
logger.go loggers: remote syslog, rfc5424 format improvements 2023-05-28 23:19:56 +02:00
remote.go added new generic remote logger and new formats 2023-05-29 13:49:38 +02:00
remote_syslog.go loggers: remote syslog, rfc5424 format improvements 2023-05-28 23:19:56 +02:00
syslog.go loggers: improved remote_syslog logging 2022-05-25 17:46:27 +02:00