Forum Discussion

swo0sh_gt_13163's avatar
swo0sh_gt_13163
Icon for Altostratus rankAltostratus
Feb 15, 2015

HSL iRule error.

Hello Folks,

I have opened a case with F5 Support for the DNS Logging which not working on a DNS VS. Describe the case background would take long. Can someone please help me correcting the following iRule snippet given by TAC? I cannot contact them today because assigned engineer isn't working on Sunday.

    =========== AFTER THIS LINE ===========
when DNS_REQUEST 
    { log local0. "Got request from [IP::client_addr] - req is [DNS::question name]"
        set hsl [HSL::open -publisher /Common/DNS-PUB] HSL::send $hsl "[DNS::question name] - [IP::client_addr]"
}

when DNS_RESPONSE {
 set rrs [DNS::answer]
 foreach rr $rrs {
  HSL::send $hsl "$rrs"
 }
}
=========== BEFORE THIS LINE ===========

This gives me following error in iRule editor.

Exception caught in LocalLB::urn:iControl:LocalLB/Rule::create()
Exception: Common::OperationFailed
    primary_error_code   : 17236305 (0x01070151)
    secondary_error_code : 0
    error_string         : 01070151:3: Rule [/Common/iRuler_Parse_Test_Rule] error: /Common/iRuler_Parse_Test_Rule:2: error: [wrong  args][when DNS_REQUEST ]
/Common/iRuler_Parse_Test_Rule:3: error: [undefined procedure:  log local0. "Got request from [IP::client_addr] - req is [DNS::question name]" ][{ log local0. "Got request from [IP::client_addr] - req is [DNS::question name]" } {
        set hsl [HSL::open -publisher /Common/DNS-PUB] HSL::send $hsl "[DNS::question name] - [IP::client_addr]"
}]

Can someone correct?

Thank you, Darshan

1 Reply

  • Looks ike it could just be a formatting problem. Try copying this exactly:

    when DNS_REQUEST { 
        log local0. "Got request from [IP::client_addr] - req is [DNS::question name]"
        set hsl [HSL::open -publisher /Common/DNS-PUB]
        HSL::send $hsl "[DNS::question name] - [IP::client_addr]"
    }
    
    when DNS_RESPONSE {
        set rrs [DNS::answer]
        foreach rr $rrs {
            HSL::send $hsl "$rrs"
        }
    }