RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1328242 - docker events: 1.10 format is not reliably machine-readable
Summary: docker events: 1.10 format is not reliably machine-readable
Keywords:
Status: CLOSED EOL
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker-latest
Version: 7.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Antonio Murdaca
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-18 20:01 UTC by Ed Santiago
Modified: 2019-04-10 12:57 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-10 12:57:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ed Santiago 2016-04-18 20:01:14 UTC
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 Hat&#2C; 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.

Comment 3 Antonio Murdaca 2016-10-23 13:50:37 UTC
Reported upstream https://github.com/docker/docker/issues/27667, let's see how the conversation goes.

Comment 4 Antonio Murdaca 2016-10-24 10:35:11 UTC
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)

Comment 5 Daniel Walsh 2016-10-24 13:18:37 UTC
Excellent. No work for us either

Comment 9 Lokesh Mandvekar 2019-04-10 12:57:39 UTC
docker-latest is EOL. Closing...


Note You need to log in before you can comment on or make changes to this bug.