openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
187 stars 57 forks source link

Possible to suppress empty messages? #36

Closed bewing closed 1 year ago

bewing commented 1 year ago

I am dealing with a system that is mapping an internal database to arbitrary path elements in gNMI where keys are part of the elem path string, instead of actually being filterable keys. As a result, I am doing a LOT of filtering on events, and in some cases, end up with messages (lists of Events) that are comprised of just empty events after using the event-drop filter to delete unwanted data. The file output looks like this:

[
  {}
]
[
  {},
  {}
]
[
  {}
]
[
  {},
  {}
]
[
  {},
  {}
]
[
  {},
  {}
]
[
  {}
]
[
  {},
  {}
]

Is it possible to completely remove empty events from the message, and drop/suppress empty messages instead of writing them to outputs further downstream?

karimra commented 1 year ago

I think it should be doable to add a knob under the output, something like ignore-empty: true

Sparc0 commented 1 year ago

would like this setting added also.

karimra commented 1 year ago

@bewing , @Sparc0 #61 makes the drop processor remove matching messages from the events list. The messages won't make it to the downstream outputs.