Hide Forgot
docker 1.10 brings significant changes to the format of the events command: - <timestamp> <sha> (from <source>) <operation> + <timestamp> <type> <operation> <identifier> (key1=val1, key2=val2) The parenthesized key=value pairs are comma-separated but there's no protection for commas, making it challenging to parse something like: (Release=56, Vendor=Red Hat, Inc., Name=rhel7/rhel, ...) There are many possible ways to address this. Some possibilities: * Backslash-escape commas within key or value: Vendor=Red Hat\, Inc. * Escape commas as HTML entities or using URL escaping: Vendor=Red HatC; Inc. or =Red Hat%2C Inc. * Double-quote values that contain space/comma/other: Vendor="Red Hat, Inc." Note that commas aren't the only characters needing escape: also equal sign, and possibly close-paren. And, given any of the above mechanisms, its corresponding escape character itself (backslash, ampersand, percent, double-quote). This is a can of worms, and there is not currently a compelling reason to parse this output... but there will be. Best to sort this out early and document it clearly.
Reported upstream https://github.com/docker/docker/issues/27667, let's see how the conversation goes.
There's a way to format the "docker events" to something like json for machine parsing (it uses Golang templates): $ docker events --format '{{json .}}' {"status":"create","id":"fc23ee06aa4bf27101795fc9d952fc4319861f5e3f0d1f66003d9ee699e22e38","from":"busybox","Type":"container","Action":"create","Actor":{"ID":"fc23ee06aa4bf27101795fc9d952fc4319861f5e3f0d1f66003d9ee699e22e38","Attributes":{"image":"busybox","name":"naughty_dijkstra","test":"a, really) not machine=readable)label,"}},"time":1477305133,"timeNano":1477305133564203266} {"status":"attach","id":"fc23ee06aa4bf27101795fc9d952fc4319861f5e3f0d1f66003d9ee699e22e38","from":"busybox","Type":"container","Action":"attach","Actor":{"ID":"fc23ee06aa4bf27101795fc9d952fc4319861f5e3f0d1f66003d9ee699e22e38","Attributes":{"image":"busybox","name":"naughty_dijkstra","test":"a, really) not machine=readable)label,"}},"time":1477305133,"timeNano":1477305133570380122} This will be in docker 1.13.x. (not sure how to close this bug)
Excellent. No work for us either
docker-latest is EOL. Closing...