Community discussions

MikroTik App
 
User avatar
tete
newbie
Topic Author
Posts: 44
Joined: Mon Jul 07, 2008 9:50 am
Location: Granada (Spain)
Contact:

Finding a string in comment

Wed Aug 12, 2009 12:46 pm

Good morning

I have been reading the manual and the forum and I have not found answer to my interrogation.

I need to find a string into the comment of a route.

I have routes like comments like: comment="route to office - FailOver" or comment="route to office - Single"

I want to identify the route using the comment. I have tried
/ip route get [find comment=(FailOver)]
But no result. How can I identify a string into the comments?

Greetings
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7195
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Finding a string in comment

Wed Aug 12, 2009 12:48 pm

you can use ~ to match by regular expression
http://wiki.mikrotik.com/wiki/Scripting#Other_Operators
 
User avatar
skillful
Trainer
Trainer
Posts: 552
Joined: Wed Sep 06, 2006 1:42 pm
Location: Abuja, Nigeria
Contact:

Re: Finding a string in comment

Wed Aug 12, 2009 5:41 pm

Try
/ip route get [find comment="FailOver"]
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7195
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Finding a string in comment

Wed Aug 12, 2009 5:48 pm

Your command will return only if comment is exac match of "FailOver". In his case it won't work.