Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-short committed Sep 5, 2014
1 parent 4539125 commit 4ddc4e7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
7 changes: 7 additions & 0 deletions 50-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$template LogglyFormat,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [TOKEN@41058 tag=\"TAG\"] %msg%\n"

*.* @@logs-01.loggly.com:514;LogglyFormat

$ModLoad imudp
$UDPServerRun 514

26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#################################################################
#
# ## .
# ## ## ## ==
# ## ## ## ## ===
# /""""""""""""""""\___/ ===
# ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
# \______ o __/
# \ \ __/
# \____\______/
#
#################################################################

FROM ubuntu:trusty
MAINTAINER Jonathan Short <[email protected]>

RUN apt-get update
RUN apt-get -y dist-upgrade

ADD run.sh /tmp/run.sh
ADD 50-default.conf /etc/rsyslog.d/50-default.conf

EXPOSE 514

CMD ["/tmp/run.sh"]

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
loggly-docker
=============

Docker container for loggly (via syslog)
Docker container for loggly (via rsyslog)

Usage:

docker run -e TOKEN=<Loggly Customer Token> -e TAG=<Tag Describing Source> sendgridlabs/loggly-docker

17 changes: 17 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

if [ -z "$TOKEN" ]; then
echo "Missing \$TOKEN"
exit 1
fi

if [ -z "$TAG" ]; then
echo "Missing \$TAG"
exit 1
fi

sed -i "s/TOKEN/$TOKEN/" /etc/rsyslog.d/50-default.conf
sed -i "s/TAG/$TAG/" /etc/rsyslog.d/50-default.conf

exec /usr/sbin/rsyslogd -n

0 comments on commit 4ddc4e7

Please sign in to comment.