<div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto">That is exactly what "filter" function does. Something like this:</div><div dir="auto">bgp_community.filter([(64511,*)]);</div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Wed, Jul 19, 2023, 17:15 Marek Küthe <<a href="mailto:m-k-mailling-list@mk16.de">m-k-mailling-list@mk16.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I recently discovered a new filter for myself on<br>
<a href="https://bgpfilterguide.nlnog.net/guides/many_communities/#bird" rel="noreferrer noreferrer" target="_blank">https://bgpfilterguide.nlnog.net/guides/many_communities/#bird</a>. In my<br>
eyes it also makes sense to keep the routing table as small as<br>
possible. But now I don't want to delete all communities, but keep a<br>
single one. How can I implement something like that?<br>
```<br>
function strip_too_many_communities() {<br>
if ( ( bgp_community.len + bgp_ext_community.len +<br>
bgp_large_community.len ) >= 100 ) then {<br>
bgp_community.empty.except((64511, *));<br>
bgp_ext_community.empty;<br>
bgp_large_community.empty;<br>
}<br>
}<br>
```<br>
<br>
The background is that these serve in the<br>
[dn42](<a href="https://dn42.dev/howto/Bird-communities" rel="noreferrer noreferrer" target="_blank">https://dn42.dev/howto/Bird-communities</a>) as information, how<br>
good the connection to the destination is. Therefore I would like to<br>
keep these.<br>
Does anyone have any ideas on how to do something like this?<br>
<br>
Greetings<br>
Marek Küthe<br>
<br>
-- <br>
Marek Küthe<br>
<a href="mailto:m.k@mk16.de" target="_blank" rel="noreferrer">m.k@mk16.de</a><br>
er/ihm he/him<br>
</blockquote></div></div>