Community discussions

MikroTik App
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

how to print a list of names?

Sun Dec 04, 2016 6:16 pm

Hello ,
I want to print all my firewall rules to see which websites I'm rejecting
this is what I did :
foreach i in=[ip firewall filter get value-name=content number=[find where action=reject]] do={:put $i} 
but I get error :
invalid internal item number
and when I do this :
:put [/ip firewall filter find where action=reject]
I get :
*4a;*4b;*4c;*16;*17;*18;*19;*21;*22;*23;*24;*25;*26;*27;*28;*29;*2a;*2b;*2c;*2d;*2e;*2f;*30;*31;*32;*33;*34;*35;*36;*37;*38;*39;*3a;*3b;*3c;*3d;*3e;*3f;*40;*41
What am I doing wrong, what am I missing?

Thanks ,
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Re: how to print a list of names?

Mon Dec 05, 2016 12:25 am

:foreach i in=[ip firewall filter find where action=reject] do={:put [/ip firewall filter get $i content]}

from memory, not tested, but should give you a direction to go in.
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: how to print a list of names?

Mon Dec 05, 2016 10:02 am

understand my mistake

Thanks !

Who is online

Users browsing this forum: No registered users and 65 guests