Community discussions

MikroTik App
 
jo2jo
Forum Veteran
Forum Veteran
Topic Author
Posts: 972
Joined: Fri May 26, 2006 1:25 am

Winbox GUI Filter Feature / Button

Tue Jun 06, 2017 5:16 am

Is my syntax off , or am i missing something when i try to filter an address , via the Winbox Filter, in /ip fire address-lists

(see attached screen shot)
reguardless of what i try to put here, i always end up with 0 results. (name filtering works fine however)

tks
winbox.JPG
You do not have the required permissions to view the files attached to this post.
:beep :beep :beep
 
rbnewfan
newbie
Posts: 28
Joined: Sat Oct 22, 2016 5:23 pm

Re: Winbox GUI Filter Feature / Button

Thu Aug 24, 2017 11:48 am

I was struggling with similar issue but in my case it seems just a limitation.
I was trying to filter out rows in Connections by two filter rules linked with logical OR. Winbox seems to only use AND implicitly for its filter function with no way to use OR.
See what I'm talking about in terms of command line:
/ip firewall connection print where src-address~"^192\\.168\\.1\\.2" or dst-address~"^1\\.2\\.3\\.4"
not possible to recreate the "OR" in winbox GUI.
I find this as a serious limitation and would be glad to see it implemented. In the GUI I would see a list of matching rows dynamically refreshed without having to re-run a command periodically.
As I see it, it can be implemented by just allowing us to write the "where" clause for the filtering manually instead of adding conditions with the plus button etc.

As to your issue, I'm also unable to make this work unless I specify a full value as found in the list. But this is the same result if I use any of "in, is, contains", which makes most options plain useless and superfluous.
 
pe1chl
Forum Guru
Forum Guru
Posts: 6674
Joined: Mon Jun 08, 2015 12:09 pm

Re: Winbox GUI Filter Feature / Button

Thu Aug 24, 2017 11:53 am

In columns that have an IP address there is a filter "in" and "not in" that you should use for those purposes.
E.g. "Address in 192.168.0.0/16"
 
rbnewfan
newbie
Posts: 28
Joined: Sat Oct 22, 2016 5:23 pm

Re: Winbox GUI Filter Feature / Button

Thu Aug 24, 2017 12:00 pm

In columns that have an IP address there is a filter "in" and "not in" that you should use for those purposes.
E.g. "Address in 192.168.0.0/16"
Ok, yes, but Contains does the same. Why then there is "contains".. The filter comparison dropdown updates with new choices when you select another field (and type of it).
But ultimately, yes, if he wants to filter by 192, then he would put this in the field: 192.0.0.0/8 which is at least something.

What about using "OR" for linking multiple filter conditions?
 
pe1chl
Forum Guru
Forum Guru
Posts: 6674
Joined: Mon Jun 08, 2015 12:09 pm

Re: Winbox GUI Filter Feature / Button

Thu Aug 24, 2017 12:08 pm

In columns that have an IP address there is a filter "in" and "not in" that you should use for those purposes.
E.g. "Address in 192.168.0.0/16"
Ok, yes, but Contains does the same. Why then there is "contains"..
Not really.
When the address is 123.192.10.8, "contains 192" would match. If it worked.
But "in 192.0.0.0/8" would not match.
 
rbnewfan
newbie
Posts: 28
Joined: Sat Oct 22, 2016 5:23 pm

Re: Winbox GUI Filter Feature / Button

Thu Aug 24, 2017 12:17 pm

That's right. Just as "contains 192" does not work, this makes it useless in this case.
192.0.0.0/8 would match "192" only in the start of the address, which is what OP wants I guess.
If we have two addresses: 192.168.1.2 and 123.192.11.2, how would I match these two with one rule containig 192? No way. If I write two rules, they are linked with AND and I would not be able to write several conditions to match "192" in the four possible parts of the address.
This leads us to my problem with "OR" :) .
Anyway, this would not be easy even if I had the chance to write 4 conditions because what this would require is something like *.192.*.*
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1750
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Winbox GUI Filter Feature / Button

Tue Jul 16, 2019 10:37 am

This may be a Bug that MT should fix.

As far as I can see, when selecting Address filter under Address List in WinBox, the drop-down contains does not work.

If I like to find all IP that contains 192, contains should be the word to select.
It should then find both:
192.168.88.1
10.192.44.32

in, only select ranges, like 192.168.88.0/24 and works well.
So what in the word are then contains and contains not used for??

contains should support regex.
 
How to use Splunk to monitor your MikroTik Router(s)

MikroTik->Splunk
 
 
pe1chl
Forum Guru
Forum Guru
Posts: 6674
Joined: Mon Jun 08, 2015 12:09 pm

Re: Winbox GUI Filter Feature / Button

Tue Jul 16, 2019 11:24 am

There are many, many other limitations on what you can do with filters.
Probably they are determined by the workings of the underlying matching mechanism.
Remember an IP address internally in the system is just a 4-byte binary value. The "192" only exists in the ASCII conversion which is being done to display it.
When the filtering happens on the original data, and then the ASCII conversion is only done for those records that match the filtering criteria, the filter your propose is not so simple.
(it would be doable for the special case shown above, as the 192 can only appear in 4 places in the binary value, but what if one filters by *11*? it could only be done on the ASCII string)
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1750
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Winbox GUI Filter Feature / Button

Tue Jul 16, 2019 12:24 pm

When you select the first column, you can select from address, comment, dynamic ++.
For all the field, the second column do change.
So since you can for address select contains and contains not.
For this reason it has to do something to the search, but I can not figure out how it works
If it does not work, fix it, or remove it.
 
How to use Splunk to monitor your MikroTik Router(s)

MikroTik->Splunk
 
 
jo2jo
Forum Veteran
Forum Veteran
Topic Author
Posts: 972
Joined: Fri May 26, 2006 1:25 am

Re: Winbox GUI Filter Feature / Button

Sun Dec 22, 2019 12:59 am

In columns that have an IP address there is a filter "in" and "not in" that you should use for those purposes.
E.g. "Address in 192.168.0.0/16"
thanks pe1chl, this does help as i had not tried this before (i just always assumed the winbox filter fuction is partially broken, which i do think it still is for the contains fuction).

funnything is i was coming back to the mt forums (in dec 2019) to post this exact same question again, but did a search first and saw i had already posted this issue/question in 2017!

mikrotik really does need to fix this, "contains" on filters just does not work, and it should.
:beep :beep :beep
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1750
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Winbox GUI Filter Feature / Button

Wed May 13, 2020 9:45 pm

MikroTik should explain what it means with contains in the firewall filter when address is selected.
I would say that this still is a bug and needs to be fixed.

Searching for address contains 192 should give positive on all these lines
192.168.0.1
10.192.20.45
16.23.192.53
72.100.20.192
 
How to use Splunk to monitor your MikroTik Router(s)

MikroTik->Splunk
 

Who is online

Users browsing this forum: dareru and 84 guests