How can I filter the output of any print command in RouterOS?
for example: ip route print - how can I get only the connected, static, etc... it does have embedded filter for BGP and OSPf though - it works.
But how can I flexibly define what I want to be displayed? I'm running full table BGP now and it's really needed.
Is there a nice guide explaining these command options?
You probably put: "/ip route
print where ?" in the console (with question mark) and you got shorter list of options:
whitespace
<value> literal value that consists only of digits, letters and
characters ._
! logical negation
" start of quoted string
$ substitution
( start of subexpression
- unary minus
> quote
[ start of command substitution
{ start of array value
~ bit inversion
bgp Find or not BGP routing protocol
check-gateway Whether all nexthops of this route are checking reachability
of gateway by sending arp requests every 10 seconds
comment Short description of the item
disabled Defines whether item is ignored or used
distance Administrative distance of the route
dst-address Destination address
ospf Find or not OSPF routing protocol
rip Find or not RIP routing protocol
routing-mark It's used for policy-routing
Type in the console: "/ip route
print where <tab>" (press [TAB] at the end) and you will get full list of options:
active bgp-weight gateway-status routing-mark
bgp blackhole mme scope
bgp-as-path check-gateway ospf static
bgp-atomic-aggregate comment ospf-metric target-scope
bgp-communities connect ospf-type type
bgp-ext-communities disabled pref-src unreachable
bgp-local-pref distance prohibit vrf-interface
bgp-med dst-address received-from
bgp-origin dynamic rip
bgp-prepend gateway route-tag
Now you see options you are looking for (connect, static).
To see static routes type:
/ip route print where static=yes
To see connected routes type:
/ip route print where connect=yes
You can combine options to filter what you want:
/ip route print where static=yes and active=yes
[TAB] key will always give you list of possible options.