Amazon-ecs-agent: Ability to write structured logs in JSON

Created on 11 Jul 2017  路  3Comments  路  Source: aws/amazon-ecs-agent

It would be great if the ECS agent logs and audit logs could write structured JSON log lines that could be more easily aggregated and queried to see what the agent is doing.

All of our docker tasks/services log structured logs to a central aggregator, and it could be useful to send the ECS agent logs to the same place and be able to query on different fields (for example, number of requests for credentials in the audit log broken down by container id, or number of tasks that entered state STARTED per host. Querying on string messages is not as nice as having structured logs.

kinenhancement kinlogging scopECS Agent

Most helpful comment

+1 on this.... I'm building things out so that that EC2 boxes that are a part of ECS includes logspout, which allows it to send out logs that goes to STDOUT to logstash to slice and dice and into elasticsearch. If the logs are in json format, it can slice and dice all the fields into elasticsearch without any extra effort of parsing.

All 3 comments

Hey @dcosson, thank you for voicing your use case and need for structured logging in the agent. Also note that the audit logs do maintain a specific formatted output as described in the troubleshooting section of the ECS docs.

+1 on this.... I'm building things out so that that EC2 boxes that are a part of ECS includes logspout, which allows it to send out logs that goes to STDOUT to logstash to slice and dice and into elasticsearch. If the logs are in json format, it can slice and dice all the fields into elasticsearch without any extra effort of parsing.

closing, tracking in #2284

Was this page helpful?
0 / 5 - 0 ratings