bird bgp_mask/ regex with sets
Hello Bird users, I am trying to filter routing table entries based on as-path regex ( I try to write regex: 32934 (3|5|7) ) bird> show route all where bgp_path ~ [= 32934 [3,5,7] =] syntax error, unexpected '[' -> I get this error bird> According to documentation I should be able to use sets inside [= =] bgpmask BGP masks are patterns used for BGP path matching (using path ~ [= 2 3 5 * =] syntax). The masks resemble wildcard patterns as used by UNIX shells. Autonomous system numbers match themselves, * matches any (even empty) sequence of arbitrary AS numbers and ? matches one arbitrary AS number. For example, if bgp_path is 4 3 2 1, then: bgp_path ~ [= * 4 3 * =] is true, but bgp_path ~ [= * 4 5 * =] is false. BGP mask expressions can also contain integer expressions enclosed in parenthesis and integer variables, for example [= * 4 (1+2) a =]. You can also use ranges (e.g. [= * 3..5 2 100..200 * =]) and sets (e.g. [= 1 2 [3, 5, 7] * =]). I tried some other options mentioned in documentation and all works, only this one with sets doesn’t work: bird> show route all where bgp_path ~ [= 32934 (4+1) =] -> works bird> show route all where bgp_path ~ [= 32934 1..5 =] -> works Is it possible to use sets, or I faced bug? Thanks, Dariusz
On Fri, Nov 22, 2019 at 03:01:05PM +0000, Mazur, Dariusz wrote:
Hello Bird users,
I am trying to filter routing table entries based on as-path regex ( I try to write regex: 32934 (3|5|7) )
bird> show route all where bgp_path ~ [= 32934 [3,5,7] =] syntax error, unexpected '[' -> I get this error bird>
According to documentation I should be able to use sets inside [= =]
Hello Which version of BIRD do you use? -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Hello Ondrej, Thanks for quick response. I use 2.0.5 /usr/bin # birdc BIRD 2.0.5 ready. bird> Thanks, Dariusz On 11/22/19, 7:50 PM, "Ondrej Zajicek" <santiago@crfreenet.org> wrote: On Fri, Nov 22, 2019 at 03:01:05PM +0000, Mazur, Dariusz wrote: > Hello Bird users, > > I am trying to filter routing table entries based on as-path regex ( I try to write regex: 32934 (3|5|7) ) > > bird> show route all where bgp_path ~ [= 32934 [3,5,7] =] > syntax error, unexpected '[' -> I get this error > bird> > > According to documentation I should be able to use sets inside [= =] Hello Which version of BIRD do you use? -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On Fri, Nov 22, 2019 at 07:36:16PM +0000, Mazur, Dariusz wrote:
Hello Ondrej, Thanks for quick response. I use 2.0.5
Well, this feature is supported since 2.0.6. I would suggest to upgrade to 2.0.7. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Mazur, Dariusz -
Ondrej Zajicek