Forum Discussion
Mattias_Holmber
Nimbostratus
Dec 09, 2008How do I get username from a POST
I have an irule that I want to do some debugging with.
So, basically I just want to write out the POST variable "username" to log.
rule get_user_id {
when HTTP_REQUEST {
if { [HTTP::uri] contains "login" } {
set username [HTTP::username]
log "username: $username"
}
}
}
what do I need more, can find much about it in the forum.
Br, Mattias
- Nicolas_Menant
Employee
Hi,when HTTP_REQUEST { if {[HTTP::uri] contains "login"} { HTTP::collect } } when HTTP_REQUEST_DATA { set parameter_vals [split [HTTP::payload] "&"] Break out the POST data for username for {set i 0} {$i < [llength $namevals]} {incr i} { set params [split [lindex $namevals $i] "="] if { [lindex $params 0] equals "username" } { set username [lindex $params 1] } } }
- Mattias_Holmber
Nimbostratus
Thanks, for your replay.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects