Loki
Systemd
[Unit]
Description=Like Prometheus, but for logs.
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
WorkingDirectory=/opt/loki
User=root
ExecStart=/bin/sh -c "./loki -config.file=/opt/loki/loki-local-config.yaml"
PrivateTmp=true
Restart=on-failure
# ExecStopPost=/bin/sh -c "python3 /opt/notify.py -t 'Loki 现已离线' -d '当前报告Loki程序已离线,请及时介入处理。'"
[Install]
WantedBy=multi-user.target
install
config
fill
{version}
wget https://raw.githubusercontent.com/grafana/loki/v${version}/cmd/loki/loki-local-config.yaml
run
./loki -config.file=/opt/loki/loki-local-config.yaml