Git Product home page Git Product logo

journal-2-logentries's Introduction

journal-2-logentries

Ship systemd journal entires to logentries.com over SSL.

Usage

sudo LOGENTRIES_TOKEN=<token> journal-2-logentries
sudo docker run -d -e 'LOGENTRIES_TOKEN=<token>' -v /run/journald.sock:/run/journald.sock \
quay.io/kelseyhightower/journal-2-logentries

Configuration

All configuration is done through env vars.

  • LOGENTRIES_JOURNAL_SOCKET - The systemd-journal-gatewayd socket. /run/journald.sock
  • LOGENTRIES_URL - The log entry url. api.logentries.com:20000
  • LOGENTRIES_TOKEN - The logentries.com TCP token -- See https://logentries.com/doc/input-token

Note: Make sure that systemd-journal-gatewayd is actually listening on /run/journald.sock. This is not done by default on CoreOS -- See example cloud-config

Building

GO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' .

Docker

docker build -t quay.io/<username>/journal-2-logentries .
docker push quay.io/<username>/journal-2-logentries

Fleet integration

etcdctl set /logentries.com/token <token>

Edit journal-2-logentries.service

[Unit]
Description=Forward Systemd Journal to logentries.com

[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill journal-2-logentries
ExecStartPre=-/usr/bin/docker rm journal-2-logentries
ExecStartPre=/usr/bin/docker pull quay.io/kelseyhightower/journal-2-logentries
ExecStart=/usr/bin/bash -c \
"/usr/bin/docker run --name journal-2-logentries \
-v /run/journald.sock:/run/journald.sock \
-e LOGENTRIES_TOKEN=`etcdctl get /logentries.com/token` \
quay.io/kelseyhightower/journal-2-logentries"

[X-Fleet]
Global=true
fleetctl start journal-2-logentries.service

journal-2-logentries's People

Contributors

kelseyhightower avatar mlafeldt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

journal-2-logentries's Issues

Allow for filtering by service

It would be nice not to have to ship the whole journal. Service whitelist or blacklist filtering could increase the utility of this library.

licence?

I'd like to reuse part of your code to forward journald to AWS CloudWatch Logs. How is the project licensed?

journald.sock: Connection Refused

Regardless if I run this through fleet or docker directly I get the following error:

Get http://journal/entries?follow: dial unix /run/journald.sock: connection refused

Thoughts?

wish: document how it fails

It would be helpful if the documentation what happened if LogEntries can't be reached over the network for some reason.

Are the logs queued in memory in this case until it's available? If so, is there an upperbound on the queue size, or would the queue size grow until memory is exhausted and the system crashes?

wish: document log format set over

Normally syslog-to-LogEntries integration doesn't include metadata, notably the "unit" name is omitted.

It would be helpful of a few sample lines of logging were provided as they would be sent to LogEntries, and notes included if the format is configurable at all.

Thanks.

Expired SSL certificates

It seems that the embedded certificates in https://github.com/kelseyhightower/journal-2-logentries/blob/master/logentries/certs.go expired yesterday, and our running journal-2-logentries containers are crashing with the error x509: certificate signed by unknown authority.

I'm forking the repo and disabling SSL certificate validation for now, but this should probably be updated in the code too. I've contacted Logentries about this as well, as the page referenced in certs.go have not been updated and still contains expired certificates. I can make a pull request with some changes here once I receive something - I'm creating a ticket for visibility right now, or if someone else has a more imminent fix for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.