Forum Discussion
Stanislas_Piro2
Sep 18, 2018Cumulonimbus
Hi,
you can use following code (not tested)
It retrieve printer name, resolve printer address with DNS servers in pool p_dns, then define as
when HTTP_REQUEST {
if {[scan [HTTP::uri] {/%[^/]/%[^/]/} corpcode printername] == 2} {
set printer "${corpcode}-${printername}.lsapps.net"
HTTP::path [string map "/${corpcode}/${printername}/ /" [HTTP::path]]
foreach dns [active_members -list p_dns] {
Check if the first list element was empty
if {[set dest [lindex [RESOLV::lookup @[lindex $dns 0] -a $printer] 0]] ne ""} {
Set Node IP based on DNS resolution
node $dest 80
break
}
}
}
}