Skip to content

Instantly share code, notes, and snippets.

@capi1O
Last active March 21, 2019 16:30
Show Gist options
  • Save capi1O/0993f016235072546d2cc68a5cbd2726 to your computer and use it in GitHub Desktop.
Save capi1O/0993f016235072546d2cc68a5cbd2726 to your computer and use it in GitHub Desktop.
curl -O https://gist.githubusercontent.com/monkeydri/0993f016235072546d2cc68a5cbd2726/raw/a6a22344d0b029731a71f04acd2d1a2a1ddc2383/td-agent-bit-template.conf
sudo bash -c "TIMBER_API_KEY=${TIMBER_API_KEY} TIMBER_SOURCE_ID=${TIMBER_SOURCE_ID} HOSTNAME=${HOSTNAME} envsubst < ./td-agent-bit-template.conf > /etc/td-agent-bit/td-agent-bit.conf"
sudo service td-agent-bit start
wget -qO - https://packages.fluentbit.io/fluentbit.key | sudo apt-key add -
sudo bash -c "echo 'deb https://packages.fluentbit.io/ubuntu/bionic bionic main' >> /etc/apt/sources.list"
sudo apt-get update && sudo apt install -y td-agent-bit
[SERVICE]
# Reduce the flush interval for better real-time access
Flush 2
[OUTPUT]
Name http
# Will match all inputs, replace with your match if you want to send a subset
Match *
tls On
Host logs.timber.io
Port 443
URI /sources/${TIMBER_SOURCE_ID}/frames
Header Authorization Bearer ${TIMBER_API_KEY}
Header Content-Type application/msgpack
Format msgpack
Retry_Limit 5
[FILTER]
Name record_modifier
# Will match all inputs, replace with your match if you want to send a subset
Match *
Record hostname ${HOSTNAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment