In Cisco IOSXR, you can attach a route-policy to a "show bgp" command so you can see how the route-policy is filtering or actioning. It's a very handy command so you can preview how the route-policy is affecting the import/export routes before you really apply the config to the peer.
Is there any similar function in Junos?
If not, what's the best way on Junos i can check what prefix the policy has been filtering or rejecting or passing. Thanks
Not sure, if an exact equivalent command is there to use (that without activating modifications show what RIB-OUT would be).
But there is a test policy command that shows if pattern defined in policy is matching. Check if this helps in any way.
thanks. The test policy command gives some sort of similar function.
A side question. Any command on Junos that is similar to XR "show bgp bestpath-compare " that shows why a path is selected as best-path?
As mentioned above, try following KB.