Skip to content

Instantly share code, notes, and snippets.

@markstos
Forked from uzyexe/logentires-systemd
Last active June 4, 2018 20:41
Show Gist options
  • Save markstos/0e24dc0e7bdd0c3474d78261f5cae783 to your computer and use it in GitHub Desktop.
Save markstos/0e24dc0e7bdd0c3474d78261f5cae783 to your computer and use it in GitHub Desktop.
systemd: Sending your CoreOS data to Logentries
[Unit]
Description=journald-to-logentries.service
# Install the nmap package to get the `ncat` dependency.
# If you want to forward just a specific unit, add `-u your-unit.service` after `journalctl`
[Service]
Environment=ACCESS_TOKEN=YOUR_LOGENTRIES_ACCESS_TOKEN
ExecStart=/bin/sh -c 'journalctl -f | sed \"s/^/${ACCESS_TOKEN} \\0/g\" | ncat --ssl data.logentries.com 443'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment