Forum Discussion
Dev_16_371257
Nimbostratus
Sep 05, 2018Need help In irule to execute condition based on URI Values
Hi Experts,
I am trying to write the I-rule where uri have 10digit numeric value and it should not contain any special character/alphabet , also the length of that numeric value is not more than 10...
Stanislas_Piro2
Cumulonimbus
Sep 05, 2018You can try this code.
First test the URI extension before splitting the URI
when HTTP_REQUEST {
if { ([HTTP::path] ends_with ".docx" || [HTTP::path] ends_with ".xlsx") && [string is digit set SN_value [getfield [URI::path [HTTP::uri] 1 2] 2 ]] && [string length $SN] == 10 } {
log local0. "Correct File extension && The uri path entry $SN_value is okay (all digits)."
return
}
else {
log local0. "The URL path entry $SN_value is not okay (non-digit characters were found)."
}
}
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