so I simplified my irule and my issue is that I cant get it to drop the first directory form the URI. I have been trying many different things I found here but nothing seems to work.
First use hsl::open to define where to send logs and save it as a vaiable HSL
when CLIENT_ACCEPTED {
set hsl [HSL::open -proto UDP -pool graylog2-syslog-pool]
}
when HTTP_REQUEST {
HSL::send $hsl "This is the HTTP URI [HTTP::uri]"
HSL::send $hsl "This is the HTTP Path [HTTP::path]"
set directory [lindex [split [string tolower [HTTP::uri]] "/"] 1]
set uri [string map {"/$directory/" "/"} [string tolower [HTTP::uri]]]
HSL::send $hsl "This is the new uri $uri"
HTTP::redirect "http://$directory.domain.com/"
when this works I will append the new uri to the redirect
}