Forum Discussion

Asaf5340's avatar
Asaf5340
Icon for Nimbostratus rankNimbostratus
Aug 12, 2019

How to catch the body response by IRULE

I want to build a Rule that when the scenario happens in the request please send a response to the log.

when HTTP_REQUEST {
    if { ( [HTTP::method] equals "POST" ) and ( [string tolower [HTTP::uri]] equals "/folder/page.php" ) } then {
            if { [HTTP::header value Content-Length] < 1048576 } then {
                HTTP::collect 1048576
            } else {
               ****** Catch the Response*****
            }
        }
    }
}

At the moment I know the method to add a variable to the request if the condition happens and then look for it in all the responses. Is there a better method that returns the response straight?

  • Hello Asaf

     

    I recommend you to check this

    https://devcentral.f5.com/s/articles/log-http-request-and-response-payload-via-hsl-and-locally-1020

     

    KR,

    Dario.