Last active
August 11, 2016 17:32
-
-
Save djfarrelly/679b37615dd2df2c3b043c5bc93ff07c to your computer and use it in GitHub Desktop.
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
FROM alpine:3.3 | |
ADD logger.sh /logger.sh | |
RUN chmod +x /logger.sh | |
CMD /bin/sh -c "/logger.sh" |
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
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
namespace: default | |
name: log-collector-test | |
spec: | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: log-collector-test | |
spec: | |
containers: | |
- image: bufferapp/buffer-log-collector-tester:1 | |
name: app | |
volumeMounts: | |
- name: log-storage | |
mountPath: /var/log | |
- name: log-collector | |
image: bufferapp/buffer-log-collector:0.2 | |
volumeMounts: | |
- name: log-storage | |
readOnly: true | |
mountPath: /var/log | |
resources: | |
limits: | |
cpu: 100m | |
memory: 200Mi | |
imagePullSecrets: | |
- name: dhbufferapp | |
restartPolicy: Always | |
volumes: | |
- name: log-storage | |
emptyDir: {} |
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
#!/bin/sh | |
HOSTNAME=$(hostname) | |
while true | |
do | |
TIMESTAMP=$(date "+%Y-%m-%dT%H:%M:%S.000Z") | |
ENTRY="{\ | |
\"name\": \"Log-Tester\",\ | |
\"hostname\": \"$HOSTNAME\",\ | |
\"@timestamp\": \"$TIMESTAMP\"\ | |
\"msg\": \"ok\"\ | |
}" | |
echo $ENTRY >> /var/log/application.log | |
echo $ENTRY | |
METRIC="{\ | |
\"name\": \"Log-Tester\",\ | |
\"date\": \"$TIMESTAMP\"\ | |
\"value\": { \"something\": 1234 }\ | |
}" | |
echo $METRIC >> /var/log/metrics.log | |
echo $METRIC | |
sleep 30 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment