Forum Discussion
Payload display incorrect format
Hi, My Irule: when RULE_INIT { Log debug to /var/log/ltm? 1=yes, 0=no set static::payload_dbg 1 set static::log_local 0 Limit payload collection to 5Mb set static::max_collect_len 5368709120 HSL pool name set static::hsl_pool "ABC" Max characters to log locally (must be less than 1024 bytes) https://clouddocs.f5.com/api/irules/log.html set static::max_chars 900 } when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool $static::hsl_pool] set clientip [IP::remote_addr] } when CLIENTSSL_HANDSHAKE { Identify the Client and negotiated cipher. } when SERVERSSL_HANDSHAKE { Identify the connected server and negotiated cipher. } when HTTP_REQUEST { set uri [HTTP::uri] set clientip [IP::client_addr] set host [HTTP::host] set method [HTTP::method]
 
log each Header.
if {[HTTP::method] eq "PUT"} {
set req_payload [HTTP::payload]
set a $req_payload
}
if {[HTTP::method] eq "POST"} {
if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048000} {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048000
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
Prevent the server from sending a compressed response
remove the compression offerings from the client
HTTP::header remove "Accept-Encoding"
Don't allow response data to be chunked
if { [HTTP::version] eq "1.1" } {
HTTP::version "1.0"
}
}
when HTTP_REQUEST_DATA {
if {[HTTP::method] eq "POST"} {
set req_payload [HTTP::payload]
}
HSL::send $hsl "$clientip $host $uri $method $req_payload"
}
Thanks
 
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