logspout
logspout copied to clipboard
RAW_FORMAT environment variable not working
I am trying to route my logs to Amplitude. The Amplitude API requires a JSON string sent, so I have tried formatting the RAW_FORMAT env variable to the appropriate string. However, when I inspect my logs via the --publish option, there seems to be no change in the format, whichever template I set. This eventually leads the logs not being sent to Amplitude.
This is the command that I run:
docker run --name="logspout" --env RAW_FORMAT='{ "api_key" : "MY_API_KEY", "events" : [{{ toJSON .Data }}] }' --volume=/var/run/docker.sock:/var/run/docker.sock --publish=127.0.0.1:8000:80 gliderlabs/logspout raw://api.amplitude.com:443/2/httpapi
It definitely works for the endpoint you send them to when sending e.g. over syslog.