Forum Discussion
Trim function with DNS records
hi all
i am writing an irule to manipulate the DNS record as it passes through a DNS virtual server by adding a string at the begining of the request name but i cannot remove a white space forme the DNS::question name variable even with trim function the iRule is as follow
when DNS_REQUEST {
set myname [concat "dc1."[string trimleft [DNS::question name " "]]]
log local0. "FQDN is $myname"
}
the output is :
Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.
Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.
Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.
Mar 23 10:46:38 BigIP1 info tmm[11026]: Rule /Common/DNS_String : FQDN is dc1.
there is a space between the string "dc1." and ";
thanks a lot for the help
2 Replies
- Stanislas_Piro2
Cumulonimbus
try this code
when DNS_REQUEST { set dnsdomain [string trimleft [DNS::question name " "]] set myname "dc1.$dnsdomain" log local0. "FQDN is $myname" } - Azzeddine_S
Cirrus
working perfectly !!!!!
thank you a lot
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com