mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +00:00
signatures: Support custom event via [event_name] syntax
This change allows to specify a per signature specific event, overriding the default signature_match event. It further removes the message parameter from such events if not provided in the signature. This also tracks the message as StringValPtr directly to avoid allocating the same StringVal for every DoAction() call. Closes #3403
This commit is contained in:
parent
d11ac929af
commit
a7b077aa17
10 changed files with 202 additions and 10 deletions
|
@ -191,6 +191,12 @@ rule_attr:
|
|||
(zeek::detail::RuleHdrTest::Comp) $2, $3));
|
||||
}
|
||||
|
||||
| TOK_EVENT '[' TOK_IDENT ']'
|
||||
{ current_rule->AddAction(new zeek::detail::RuleActionEvent(nullptr, $3)); }
|
||||
|
||||
| TOK_EVENT '[' TOK_IDENT ']' string
|
||||
{ current_rule->AddAction(new zeek::detail::RuleActionEvent($5, $3)); }
|
||||
|
||||
| TOK_EVENT string
|
||||
{ current_rule->AddAction(new zeek::detail::RuleActionEvent($2)); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue