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.
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?
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..*
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)
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.
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.
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
Your input is wrong. When you use “in” you should use a valid subnet, so 10.11.31.0/24 not 10.11.31.252/24.
Winbox shows it is wrong by coloring it red.