-
-
Notifications
You must be signed in to change notification settings - Fork 32
Subscription processor pipeline #597
Comments
all processors have a condition that tells if they need to be executed on the event message or not, it takes a jq expression |
I did a quick spot check, because I didn't remember seeing this in the documentation that I reviewed -- while condition is present on some processors, it doesn't appear to be universal.
|
Agree, it's not present for all processors. I didn't see a need for it be present for all of them ( which is wrong ) A solution for this issue would be to implement the condition check for all processors, applying a processor to messages from a subscription sub1 would just need |
Is this implemented or is it just a idea how to solve the issue? Because i have a processor i only want to run on the subscription named interface_state
This processor will drop all my other paths i subscribe on for cpu, memory etc. I could use event-drop instead to drop all interfaces i dont want but using the event-allow would make the config more understandable. And no i cant do a more specific subscribe call for interface since JunOS wont let me fetch all ae interfaces when i do
But it let me fetch all et interfaces when i do
I have a JTAC ticket about this already. |
@Sparc0 Processors apply to updates from a |
@karimra so docs says condition or one of the regular expressions under tags, tag-names, values or value-names. |
Yes, an event message is allowed if the condition is true You could combine all those regular expressions with the subscription name under (.name == "interface_state")
and
(
.tags.interface_name |
(
test("ae\\w+")
or
test("ge-.{5}")
or
test("xe-.{5}")
or
test("et-.{5}")
or
test("fxp\\w?")
or
test("em\\w?")
or
test("irb")
)
) Note that the subscription name is also present as a tag (.tags."subscription-name" == "interface_state")
and
(
.tags.interface_name |
(
test("ae\\w+")
or
test("ge-.{5}")
or
test("xe-.{5}")
or
test("et-.{5}")
or
test("fxp\\w?")
or
test("em\\w?")
or
test("irb")
)
)
|
Right now, formatters/processors are assigned to a specific output. I would consider it useful to be able to apply a set of processors only to events for a given subscription. One way to accomplish this would be to chain "filter" formatters, where you can have a formatter that evaluates a condition, and has its own list of processors for further event processing if it evaluates to true.
The text was updated successfully, but these errors were encountered: