Replies: 5 comments 1 reply
-
Would using
What's the reason for it losing them? Assuming it's using the normal RE code, shouldn't it just return whether it matched or not? |
Beta Was this translation helpful? Give feedback.
-
would be perfect. Because of the question I was even thinking how else you would use this.. and then I thought of paraglob. Then I wondered if paraglob could do this either. It turns out, yes.. but it's a few steps. This also has the limitation that it can only do the basic patterns that paraglob supports.
|
Beta Was this translation helpful? Give feedback.
-
BTW turns out that I was wrong about supporting |
Beta Was this translation helpful? Give feedback.
-
I'm all for supporting faster set-matching. I also agree that Paraglob isn't the way to go here, not only because it's clumsy to make it support this use case, but especially because of its focus on globs. I do have a few comments on the table approach:
For the subnet-indexed table scenario there's a set of BiFs that address other lookup needs: Btw — I currently can find neither documentation of the |
Beta Was this translation helpful? Give feedback.
-
Vern's work has been integrated. Closing this discussion. |
Beta Was this translation helpful? Give feedback.
-
@JustinAzoff and I were discussing how we could significantly speed up some of our code that currently loops through sets of
pattern
s if Zeek could tell us which pattern(s) were matched. For example, it would be neat if code like this:would print
My recollection was that Zeek in fact has this information internally but it gets lost in the layering used for matching
pattern
s. I took a look in the internals and sure enough that's the case, and in fact this is leveraged by the signature framework to tell which of several signatures have matched.I took a quick stab at prototyping and got the above example to work with < 150 lines of new code (
topic/vern/pattern-tables-work
). Assuming that given its feasibility, there's interest in developing this further (which I'd hope, as it really is helpful in some situations!), several questions come to mind:table[pattern] of X
the right way to expose this feature to users? It's certainly convenient for some cases..*
on either side to make a pattern anywhere./.../i
or/.../s
distinctions? (The prototype just loses these.) It would not be hard to make them apply to all patterns, but due to the way the implementation works they would be difficult to support for only some of the patterns but not others. Un-pretty.BTW I'm perfectly happy for someone else to pick up the prototype and build out the rest - just would like to see some functionality along these lines available sometime soon!
Beta Was this translation helpful? Give feedback.
All reactions