specialization of the logspout container modified to set the hostname including the instance ID on ECS
This small tweak runs a small shell script before invoking logspout to get the instance ID from the EC2 metatdata. It then appends that to whatever is passed in as the SYSLOG_HOSTNAME environment variable to use the final value as the syslog hostname. If not SYSLOG_HOSTNAME variable is present, the syslog hostname is just set to the hostname as per default logspout behaviour.
This is useful when running on AWS ECS and sending logs to papertrail because you can then see which ECS cluster node your container is running on.
Ensure you pass in SYSLOG_HOSTNAME as an environment variable.