Skip to main content
Question

I am needing to modify a default filter in a pack,

  • Mar 11, 2025 3:18 AM UTC
  • 6 replies
  • 124 views

So, I'm finding myself needing to modify a default filter in a pack, which currently says:```C.Net.isPrivate(srcaddr) && C.Net.isPrivate(dstaddr) && action=='ACCEPT'```

6 replies

Raanan Dagan

hate to tell you, but the http://C.Net|C.Net function is expensive. Regex might be a little lighter, beleive it or not.


Raanan Dagan

specifically if you have a high volume of data you're checking as to whether it's RFC1918 or not


Raanan Dagan

I cratered Stream until we figured that out while I was checking the same thing for Palo Alto logs (lots of big logs with lots of IPs).


my new subnet falls on clean octet boundaries, so that shouldn't be too hard


Raanan Dagan

I'd move the initial check to your pre-process pipeline/pack and create a temporary boolean variable to use in your filter.


Raanan Dagan

something like, `__isPrivate==true` kind of thing