This commit is contained in:
Kameron Kenny 2024-06-07 17:36:32 -04:00
parent 76abace0a1
commit 682bde64bb
No known key found for this signature in database
GPG Key ID: E5006629839D2276
3 changed files with 161 additions and 16 deletions

View File

@ -1,6 +1,6 @@
FROM lscr.io/linuxserver/syslog-ng:latest FROM lscr.io/linuxserver/syslog-ng:latest
LABEL version="20240607.1.1" LABEL version="20240607.1.2"
LABEL description="syslog-ng" LABEL description="syslog-ng"
RUN mkdir -p /config RUN mkdir -p /config

View File

@ -2,29 +2,174 @@
# Default syslog-ng.conf file which collects all local logs into a # Default syslog-ng.conf file which collects all local logs into a
# single file called /var/log/messages tailored to container usage. # single file called /var/log/messages tailored to container usage.
@version: 4.7 @version: 4.2
@include "scl.conf" @include "scl.conf"
source s_local { source s_local { internal(); };
internal(); source s_network_tcp { syslog(transport(tcp) port(6601)); };
}; source s_network_udp { syslog(transport(udp) port(5514)); };
source s_network_tcp { filter f_unifi_fw_lan { match("LAN" value("PID")); };
syslog(transport(tcp) port(6601)); filter f_unifi_fw_wan { match("WAN" value("PID")); };
}; filter f_unifi_fw_dnat { match("DNAT" value("PID")); };
filter f_unifi_dnsmasq { match("dnsmasq" value("PID")); };
source s_network_udp { filter f_unifi_systemd { match("systemd" value("PID")); };
syslog(transport(udp) port(5514)); filter f_unifi_stahtd { match("stahtd" value("PID")); };
}; filter f_unifi_mcad { match("mcad" value("PID")); };
filter f_unifi_hostapd { match("hostapd" value("PID")); };
filter f_unifi_wlan { message("wlan:"); };
destination d_local { destination d_local {
file("/var/log/messages"); file("/var/log/messages");
file("/var/log/messages-kv.log" template("$ISODATE $HOST $(format-welf --scope all-nv-pairs)\n") frac-digits(3)); file("/var/log/messages-kv.log" template("$ISODATE $HOST $(format-welf --scope all-nv-pairs)\n") frac-digits(3));
}; };
destination d_unifi_fw { file("/var/log/unifi_fw.log"); };
destination d_unifi_firewall {
elasticsearch-http(
index("unifi-firewall")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
destination d_unifi_dnsmasq {
elasticsearch-http(
index("unifi-dnsmasq")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
destination d_unifi_systemd {
elasticsearch-http(
index("unifi-systemd")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
destination d_unifi_stahtd {
elasticsearch-http(
index("unifi-stahtd")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
destination d_unifi_mcad {
elasticsearch-http(
index("unifi-mcad")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
destination d_unifi_hostapd {
elasticsearch-http(
index("unifi-hostapd")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
destination d_unifi_wlan {
elasticsearch-http(
index("unifi-wlan")
type("")
user("elastic")
password("forty6and2")
url("http://pi501.in.thelinuxpro.net:9200/_bulk")
persist-name("persist")
);
};
log {
source(s_network_udp);
filter(f_unifi_fw_lan);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_fw_wan);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_fw_dnat);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_dnsmasq);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_systemd);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_stahtd);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_mcad);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_hostapd);
destination(d_unifi_firewall);
flags(final);
};
log {
source(s_network_udp);
filter(f_unifi_wlan);
destination(d_unifi_firewall);
flags(final);
};
log { log {
source(s_local); source(s_local);
source(s_network_tcp); source(s_network_tcp);
source(s_network_udp); source(s_network_udp);
destination(d_local); destination(d_local);
}; };

View File

@ -8,10 +8,10 @@ volumes:
services: services:
syslog-ng: syslog-ng:
#build: build:
#dockerfile: Dockerfile dockerfile: Dockerfile
#image: docker-registry1.in.thelinuxpro.net:5000/tlp/syslog-ng:240607.1.1 image: docker-registry1.in.thelinuxpro.net:5000/tlp/syslog-ng:240607.1.2
image: lscr.io/linuxserver/syslog-ng:latest # image: lscr.io/linuxserver/syslog-ng:latest
container_name: syslog-ng container_name: syslog-ng
environment: environment:
- PUID=0 - PUID=0