Here's two methods:
when HTTP_REQUEST {
going to split the URI on the "/" character and loop through the list
set newURI ""
for { set x 0 } { $x < [llength [split [HTTP::uri] "/"]] } { incr x } {
if { $x == 1 } {
this is the first path - the one we want to set to lowercase
append newURI "[string tolower [lindex [split [HTTP::uri] "/"] 1]]/"
} else {
append newURI "[lindex [split [HTTP::uri] "/"] $x]/"
}
}
the above append loop adds an unnecessary "/" at the end, so strip it here
set newURI [string range $newURI 0 end-1]
log local0. $newURI
}
or:
effectively splitting the first part of the URI away from everything else, in one long string manipulation statement
set newURI1 [string tolower [string range [HTTP::uri] 0 [string first "/" [HTTP::uri] 1]]][string range [HTTP::uri] [expr [string first "/" [HTTP::uri] 1] + 1] end]
log local0. $newURI1
Both just deal with the URI, so to get the full URL, just do this:
[HTTP::host]$newURI