Skip to content

How to filter events? #70

@bendavis78

Description

@bendavis78

I'm trying to filter events by type=container, but this doesn't seem to work:

docker.events({
  since: ((new Date().getTime() / 1000)).toFixed(0),
  filter: {
    type: 'container'
  }
}).then(stream => {
  stream.on('data', data => {
    const event = JSON.parse(data.toString());
    logger.info(`DOCKER EVENT: Type=${event.Type} status=${event.status} from=${event.from}`);
  });
});

With the above code, I still get all event types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions