Page 1 of 1
Selecting records
Posted: Fri Nov 19, 2004 11:29 am
by dusan
Hi all,
I want to select some simple queues according IP address. I have some queues from subnet 192.168.15.0/24 (about 20 queues). I want to select only them, for example :put [find target-address=192.168.15.xxx], but I' don't know how to express it. I didn't find anyting similar in manuals. Thanks for answers.
Posted: Mon Nov 22, 2004 11:43 am
by edzix
use :for to accomplish this, but in this case those 20 IP should be with the same step. For example, if you have IPs from 192.168.15.10 to 192.168.15.20 then:
/queue simple {:for i from 10 to 20 do=[:put [find target-address=("192.168.15." . $i)]}
Edgars
Selecting records
Posted: Mon Nov 22, 2004 12:02 pm
by dusan
well, it's not exactly what I wanted, I looked for something like "looking for some*". But this is probably currently unable.
No matter, thanks for answer.
Posted: Mon Nov 22, 2004 2:12 pm
by edzix
maybe you can write what exactly is the aim you want to reach? What would you like to do with those queues which are found?
Edgars
Selecting records
Posted: Mon Nov 22, 2004 7:38 pm
by dusan
I want to export only a part of all my simple queues, in this example all queues belonging to subnet 192.168.15.0/24. So I want to select all simple queues, that have a begin 192.168.15.xxx:
/queue simple export from [find target-address=192.168.15.10]
this command will export only address 192.168.15.10 and my idea is by some simple trick select all queues with 192.168.15. begining, maybe something like this:
/queue simple export from [find target-address=192.168.15.*]
I didn't find way how to do it, I'm sorry, if I looked bad.
Posted: Tue Nov 23, 2004 2:36 pm
by edzix
no, it's not possible. Maybe in v2.9, but it will be very complex script.
Edgars
Posted: Mon Nov 29, 2004 2:45 pm
by Eugene
Very complex script, indeed
:global temp1; :set temp1 ""; :for i from 1 to 254 do={:set temp1 ($temp1 . "," . [/queue simple find target-address=(192.168.15. . $i)])}; /queue simple export from ($temp1);