Community discussions

MUM Europe 2020
 
jmginer
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Tue Dec 11, 2012 4:56 am

How to filter "ip firewall address-list"

Fri Aug 04, 2017 12:41 pm

Hello, I want print all the address-list records if the address is inside a subnet

If I enter the exact match, is ok:
 
 > ip firewall address-list print where address=46.229.168.10
Flags: X - disabled, D - dynamic 
 #   LIST                      ADDRESS                                       CREATION-TIME        TIMEOUT             
 0 D ;;; test
     test                     46.229.168.10                               jul/24/2017 13:06:13 11w2d3h14m29s       
but if I run
 ip firewall address-list print where address=46.0.0.0/8
the result is null

There is any option to filter by network via console/API ?

Thanks!!!
 
jmginer
Member Candidate
Member Candidate
Topic Author
Posts: 115
Joined: Tue Dec 11, 2012 4:56 am

Re: How to filter "ip firewall address-list"

Mon Aug 07, 2017 1:42 pm

up up! :)
Any idea?
 
User avatar
gnro
just joined
Posts: 16
Joined: Sun Aug 05, 2018 9:52 am

Re: How to filter "ip firewall address-list"

Thu Dec 19, 2019 3:58 pm

Hi,

I know it's an old topic, but the answer is simple using the list name:
/ip firewall address-list print where list="list_name"
 
User avatar
gnro
just joined
Posts: 16
Joined: Sun Aug 05, 2018 9:52 am

Re: How to filter "ip firewall address-list"

Thu Dec 19, 2019 4:04 pm

Or using filter by address and not by address list name:
/ip firewall address-list print where address ~"46"

/ip firewall address-list print where address ~"192.168.1.[8]"

/ip firewall address-list print where address ~"55.[1]"
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 1540
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

Re: How to filter "ip firewall address-list"

Thu Dec 19, 2019 4:39 pm

Or using filter by address and not by address list name:
/ip firewall address-list print where address ~"46"

/ip firewall address-list print where address ~"192.168.1.[8]"

/ip firewall address-list print where address ~"55.[1]"

very cool, learned something new again, the [] part, thank you for sharing
MTCNA, MTCTCE, MTCRE & MTCINE
 
User avatar
eworm
Member
Member
Posts: 445
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: How to filter "ip firewall address-list"

Thu Dec 19, 2019 4:54 pm

You can use POSIX regular expressions, with some exceptions.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
User avatar
CZFan
Forum Guru
Forum Guru
Posts: 1540
Joined: Sun Oct 09, 2016 8:25 pm
Location: South Africa, Randburg
Contact:

Re: How to filter "ip firewall address-list"

Thu Dec 19, 2019 5:21 pm

You can use POSIX regular expressions, with some exceptions.
Cool, thank you
MTCNA, MTCTCE, MTCRE & MTCINE

Who is online

Users browsing this forum: eworm, MSN [Bot] and 113 guests