Last active
August 29, 2015 14:16
-
-
Save cgswong/4c2751b174e59fdcd0af to your computer and use it in GitHub Desktop.
Log forwarder systemd unit for any OS with journal logs (CoreOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Journal redirect to remote | |
[Service] | |
Restart=on-failure | |
StartLimitInterval=60s | |
StartLimitBurst=3 | |
TimeoutStartSec=0 | |
ExecStart=/bin/sh -c '/usr/bin/journalctl -f -o short | /usr/bin/ncat [hostname/IP] [port]' | |
PIDFile=/var/run/journalncat.pid | |
ExecStop=/bin/kill -TERM `cat /var/run/journalncat.pid` | |
[Install] | |
WantedBy=multi-user.target | |
[X-Fleet] | |
Global=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment