BGP community tagging during redistribution?

I’m trying to integrate MikroTik gear into an existing network that uses BGP communities to enforce routing policies. I need to have static and connected routes redistributed, but each route origin needs a different BGP community set. In the Cisco world, I do something like this:

router bgp 65390
 redistribute connected route-map tag.connected
 redistribute static route-map tag.static
!
route-map tag.connected permit 10
 set community 65390:501
!
route-map tag.static permit 10
 set community 65390:500

I can see several ways to do this, but all seem to require that I have address based filters on the MikroTik. Is there a better way in RouterOS that I’m missing?

A filter like the one below should accomplish both the tagging and the redistribution.

/route filter add chain=addcommunities protocol=connect append-bgp-communities=65390:501 action=accept
/route filter add chain=addcommunities protocol=static append-bgp-communities=65390:500 action=accept

Thanks! That’s exactly what I was looking for, but hadn’t made it over past “stumbling on syntax” with RouterOS!