Forum Discussion

Girishf5_387421's avatar
Girishf5_387421
Icon for Nimbostratus rankNimbostratus
Apr 04, 2019

Issue in xml based http Irule

HI...while configuring the irule xml based http .we are facing some issue

 

Irule :- when HTTP_REQUEST { set capture 0

 

if { [HTTP::header exists Content-length] and [ [HTTP::method] equals "POST" }]
    set capture 1
    HTTP::collect [HTTP::header Content-Length]

}

 

when HTTP_REQUEST_DATA {

 

if {$capture} {

 

if { [HTTP::payload] contains "UE" } {

 

log local0. "Logs: triggered wanted pool" pool WEBRTC_POOL }

 

} else 
    {
    pool PUSH_POOL
    }

}

 

Error:- 01070151:3: Rule [/Common/hi] error: /Common/hi:5: error: [parse error: PARSE missingBracket 86 {missing close-bracket}][{ [HTTP::header exists Content-length] and [ [HTTP::method] equals "POST" }]

 

Please help us to troubleshoot the issue in this code

 

1 Reply

  • Hi dude,

    I fix all missing brace... so now you will not have any errors:

    when HTTP_REQUEST {
    
    set capture 0
    
    if { [HTTP::header exists Content-length] and [HTTP::method] equals "POST" } {
        set capture 1
        HTTP::collect [HTTP::header Content-Length]
    }
    }
    
    when HTTP_REQUEST_DATA {
    if {$capture} {
        if { [HTTP::payload] contains "UE" } {
            log local0. "Logs: triggered wanted pool" 
            pool WEBRTC_POOL
        }
    } else {
        pool PUSH_POOL
    }
    }