Community discussions

MikroTik App
 
1littlewisp
newbie
Topic Author
Posts: 36
Joined: Wed Jun 10, 2009 6:23 pm

having some troubles with [find...]

Sat Apr 09, 2011 12:26 am

so I'm trying to use find to change queues. what I'd like to do is change them based on what they're set at now. So I'm using find like this:

/queue simple print from=[find burst-limit=5120k/5120k]

just to try to get the data that I want to change. the command above doesn't work. it does work when I look for other parameters, though. For example:

/queue simple print from=[find interface=all]

My question for the community is: wtf?

thanks.
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: having some troubles with [find...]

Sat Apr 09, 2011 12:38 am

Some parameters (I wish I could be more accurate than the word 'some', but there you go) require quotation marks.

Try
/queue simple print from=[find burst-limit="5120k/5120k"]
It may also be helpful to always fully specify the paths just in case scope isn't what you expected:
/queue simple print from=[/queue simple find burst-limit="5120k/5120k"]
That said, I don't know how to interpret that use of 'from'. If you only want to print certain elements I am under the impression you should be using 'where':
/queue simple print where burst-limit="5120k/5120k"
 
1littlewisp
newbie
Topic Author
Posts: 36
Joined: Wed Jun 10, 2009 6:23 pm

Re: having some troubles with [find...]

Tue Apr 12, 2011 6:59 pm

Oh, I see. I just needed to escape the values of burst-limit because the "/" is a special character. I'll tell you what the ultimate goal is here: to change the bust limits of queues that meet certain conditions. In other words, "if the queue's burst-limit is 5120k/5120k, set it to 10240k/10240k."

How would you do that?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

Re: having some troubles with [find...]

Tue Apr 12, 2011 8:35 pm

/queue simple set [/queue simple find burst-limit="5120k/5120k"] burst-limit="10240k/10240k";
 
1littlewisp
newbie
Topic Author
Posts: 36
Joined: Wed Jun 10, 2009 6:23 pm

Re: having some troubles with [find...]

Tue Apr 12, 2011 9:41 pm

Thanks, fewi. I'm not well trained in programming logic, so learning the CLI can be especially difficult. I've written a few scripts with conditional statements, but anything C-like really starts to screw with me. I've been trying to figure it out by trial and error, picking up bits of information here or there, but I was limited by a poor foundational understanding.