This is an example of making fluentd count log messages and emit to graphite.
Run in a terminal:
# start graphite statsd
docker run -d --name graphite --restart=always -p 80:80 -p 2003-2004:2003-2004 -p 2023-2024:2023-2024 -p 8125:8125/udp -p 8126:8126 hopsoft/graphite-statsd
# start fluentd container
./build.sh
Then in another terminal session:
docker run --name source4 --log-driver=fluentd --log-opt tag="docker.socool.{{.ID}}" --log-opt fluentd-address="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' custom-docker-fluent-logger):24224" python:alpine echo $'Hello\nBye\nMore\nAnd\n\So\nLots'