Community discussions

MikroTik App
 
User avatar
ploquets
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Tue Nov 17, 2015 12:49 pm
Location: Uruguaiana, RS, Brazil
Contact:

Logical operator "not in"

Fri May 11, 2018 4:57 pm

Hello... I've been searching about this sintaxe, but did not find anything useful.

Does somebody knows how to get this command to work?
/ppp active print count-only where (address in 203.0.113.0/24 AND address not in 203.0.113.0/27)
Thank you
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: Logical operator "not in"

Sat May 12, 2018 7:13 am

 /ppp active print count-only where (address in 203.0.113.0/24 AND address in !203.0.113.0/27)
 
User avatar
ploquets
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Tue Nov 17, 2015 12:49 pm
Location: Uruguaiana, RS, Brazil
Contact:

Re: Logical operator "not in"

Sat May 12, 2018 3:17 pm

 /ppp active print count-only where (address in 203.0.113.0/24 AND address in !203.0.113.0/27)
Doesn't work.
Have you tested your code?

Thanks in advance
 
2frogs
Forum Veteran
Forum Veteran
Posts: 713
Joined: Fri Dec 03, 2010 1:38 am

Re: Logical operator "not in"  [SOLVED]

Sat May 12, 2018 5:11 pm

Well it didn’t show an error, but here you go:
/ppp active print count-only where (address in 203.0.113.0/24 and !(address in 203.0.113.0/27))
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Logical operator "not in"

Sat May 12, 2018 7:25 pm

203.0.113.0/27 = {203.0.113.0 - 203.0.113.31}
so range begin 203.0.113.32 to 203.0.113.254
/ppp active print count-only where address~( "203\\.0\\.113\\.(3[2-9]|[4-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-4]))" )
use this link may help you about IP regular expression
http://www.analyticsmarket.com/freetools/ipregex
 
User avatar
ploquets
Member Candidate
Member Candidate
Topic Author
Posts: 162
Joined: Tue Nov 17, 2015 12:49 pm
Location: Uruguaiana, RS, Brazil
Contact:

Re: Logical operator "not in"

Mon May 14, 2018 5:15 pm

Well it didn’t show an error, but here you go:
/ppp active print count-only where (address in 203.0.113.0/24 and !(address in 203.0.113.0/27))
Nice!!!!!!

This worked like a charm
Thank you

Who is online

Users browsing this forum: No registered users and 9 guests