Community discussions

MikroTik App
 
OliverST
just joined
Topic Author
Posts: 21
Joined: Sun Aug 16, 2015 9:14 pm

Find and list filter by comment

Mon Nov 09, 2020 8:22 pm

Hi, i write some app and the server-side code is php.
need to select and list the filter by comment. This part will be for enabling - disabling filters like blocking youtube or some games

could someone help me please.
thx

$ARRAY = $API->comm('/ip/firewall/filter/print', false);
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Find and list filter by comment

Mon Nov 09, 2020 8:46 pm

/ip firewall filter disable [:find comment~"Yoeptube"]; This is in ROS script.

Replace Yoeptube with you use and it can also a partly match like tube because of the ~ instead of a =
 
OliverST
just joined
Topic Author
Posts: 21
Joined: Sun Aug 16, 2015 9:14 pm

Re: Find and list filter by comment

Mon Nov 09, 2020 9:05 pm

Thank you , will try it

now i have like this:
$API->comm("/ip/firewall/filter/getall", array("?comment" => "BLOCKED"));
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: Find and list filter by comment

Mon Nov 09, 2020 9:28 pm

Let RouterOS do this for you and look at how you normally enable and disable lines.

You are now collecting the lines and that is not needed.

Who is online

Users browsing this forum: netmas and 23 guests