Simple Queues script to change type

Greetings Miktorik Guru’s

Picking up that we have a few of our simple queues that were mistakenly left on defaults or not changed to “wireless default”
Is there a nice and easy way to find and replace?

Wrong entry with bad human input:

add max-limit=10M/10M name="MJane Smith" target=192.168.10.123/32 total-queue=default-small

(or without any total-queue type)

But it should read:

add max-limit=10M/10M name="John Doe" target=192.168.10.10/32  total-queue=wireless-default

Any suggestions for a script or command one can run to fix this?
My ideas / plans / efforts were all greeted with errors and I’m sure this is such an easy question for those who can code, its like 20 keystrokes and there is a solution

Thanks!

set [find total-queue=“default-small” ] total-queue=wireless-default

Thanks for a super fast responce, mrz!
Running from Terminal has not visible result. Neither can I see any changes in the simple queues.
[RTR-name] /queue simple>> set [find total-queue=“default-small” ] total-queue=wireless-default

If you have more than one item with total-queue=“default-small” then you need to iterate through find results.
For example using foreach

:foreach i in=[find where total-queue="default-small"] do={set $i total-queue=wireless-default }

@mrz
You are a total genius with this! Thanks for your assistance.
One last request for some of your knowledge:

Some of the /queue simple lines do NOT have the “total-queue” parameter.
How would one go about to insert that?
I played around with:
:foreach i in=[find where total-queue=“”] do={set $i total-queue=wireless-default }
But clearly I’m talking rubbish to my router :slight_smile:

Any of our forum members who can assist with the above “bad” command I’m trying to pump into the router?

Hey, this should work:

:foreach i in=[/queue simple find where total-queue!="wireless-default"] do={/queue simple set $i total-queue=wireless-default}

@skylark - YOU are amazing my friend. Thank you so much for that command! You have me sorted out now.

Curiously, neither (total-queue=“”) nor (total-queue is nil) work. One of these really should work.

What does work is:

:foreach i in=[find where (“foo” . total-queue) = “foo”] do={…}

Note that the previous post marked “solution” will simply set every entry to wireless-default, even if it had been deliberately set to something else. If you had wanted to do that, you could have just issued:

set [find] total-queue=wireless-default

@macsrwe Indeed, my intention was to override whatever the parameters are (or those without any), to “total-queue=wireless-default” … and then manually change the few who need to be on something else, to whatever is needed for them. Easier to change 10 afterward, than change 200.