Skip to content

Instantly share code, notes, and snippets.

@uzyexe
Last active June 4, 2018 20:42
Show Gist options
  • Save uzyexe/c634a62c8e4f91d833ba to your computer and use it in GitHub Desktop.
Save uzyexe/c634a62c8e4f91d833ba to your computer and use it in GitHub Desktop.
systemd: Sending your CoreOS data to Logentries
[Unit]
Description=logentires.service
[Service]
Environment=ACCESS_TOKEN=YOUR_LOGENTRIES_ACCESS_TOKEN
ExecStart=/bin/sh -c 'journalctl -o short -f | sed \"s/^/${ACCESS_TOKEN} \\0/g\" | ncat data.logentries.com 10000'
@markstos
Copy link

markstos commented Jun 4, 2018

Elegant. Thanks for sharing. I made a fork with a couple improvements.

  • SSL is used to encrypt the communication
  • Including "-o short" is not necessary, it is the default format.
  • Service name updated to be more descriptive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment