NethServer / dev

NethServer issue tracker
https://github.com/NethServer/dev/issues
62 stars 20 forks source link

Set Loki forwarders to syslog and Cloud Log Manager #6932

Closed tommaso-ascani closed 2 months ago

tommaso-ascani commented 4 months ago

Implementation of new ui components to manage logs forwarders.

There will be two available kind of services:

New elements:

DavidePrincipi commented 3 months ago

In testing:

tommaso-ascani commented 2 months ago

Test Case

Requirements:

Cloud Log Manager

Step to set forwarders

To check

Syslog

Example of syslog server

It is possible to start a syslog server insde a docker/podman container for testing purpose, here an example of docker-compose.yml:

services:
  syslog:
    image: balabit/syslog-ng:latest
    container_name: syslog
    ports:
      - 514:514/udp
      - 601:601/tcp
    volumes:
      - $PWD/syslog-ng.conf:/etc/syslog-ng/syslog-ng.conf
    restart: always

syslog-ng.conf:

@version: 4.6

source s_external {
        network(ip("0.0.0.0") port(601) transport(tcp) flags(no-parse,store-raw-message));
        network(ip("0.0.0.0") port(514) transport(udp) flags(no-parse,store-raw-message));
};

template forward_template {
        template("$RAWMSG\n");
};

destination d_external {
        file("/var/log/messages" template(forward_template));
};

log {
        source(s_external);
        destination(d_external);
};

WARNING: Forwarder correct working could depend on syslog server configuration, so if you are not able to let it work properly, check your configuration.

Step to set forwarders:

To check

For both forwarders

To check

DavidePrincipi commented 2 months ago

In testing:

DavidePrincipi commented 2 months ago

In testing:

DavidePrincipi commented 2 months ago

In testing:

DavidePrincipi commented 2 months ago

VERIFIED

DavidePrincipi commented 2 months ago

Released