Vector Routing and GEOIP #10197
tastyfrankfurt
started this conversation in
General
Replies: 1 comment 3 replies
-
I have identified why the routing above is not working as its a problem with json, current json is looking for the value represented as follows, But the value in the json we are handling is stored as follows, is there a way to cater for the '.' as a string value rather than a sub element? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey Guys,
Trying to convert logstash to vector having a few issues with the routing transform and geoip logic. Basically the transform below is not matching the check statements even though the fields are there i. Yes we have a parsing map above that i have tested by deleting and adding fields. I have tested each below with vector vrl and it works fine.
t_kfk_parsed_route_geoip:
type: route
inputs: [t_kfk_parsed_route.parsesuccess]
route:
"geoipsrc": exists(.source.ip) && !match!(.source.ip,r'(^127.0.0.1)|(^10.)|(^172.1[6-9].)|(^172.2[0-9].)|(^172.3[0-1].)|(^192.168.)|(^169.254.)|(^22[4-9]{1}.)|(^23[0-9]{1}.)|(^255.255.255.255)')
"geoipdst": exists(.destination.ip) && !match!(.destination.ip,r'(^127.0.0.1)|(^10.)|(^172.1[6-9].)|(^172.2[0-9].)|(^172.3[0-1].)|(^192.168.)|(^169.254.)|(^22[4-9]{1}.)|(^23[0-9]{1}.)|(^255.255.255.255)')
"geoipsrcnat": exists(.source.ip_nat) && !match!(.source.ip_nat,r'(^127.0.0.1)|(^10.)|(^172.1[6-9].)|(^172.2[0-9].)|(^172.3[0-1].)|(^192.168.)|(^169.254.)|(^22[4-9]{1}.)|(^23[0-9]{1}.)|(^255.255.255.255)')
"geoipdstnat": exists(.destination.ip_nat) && !match!(.destination.ip_nat,r'(^127.0.0.1)|(^10.)|(^172.1[6-9].)|(^172.2[0-9].)|(^172.3[0-1].)|(^192.168.)|(^169.254.)|(^22[4-9]{1}.)|(^23[0-9]{1}.)|(^255.255.255.255)')
Additionally because of the way the geoip transform works we have to run it back through multiple geoip transforms as some logs have multiples of the fields above, ie .destination.ip and .source.ip exist in the same log message. It would be great in geoip could be incorporated into the vector vrl remap implementation.
Beta Was this translation helpful? Give feedback.
All reactions