Forum Discussion

Re: help with syntax for trim command

Hi Ben,

 

 

The user-agent should be URI encoding the space into a %20 before sending the HTTP request. String trim works fine when you want to trim any set of individual characters but not a specific sequence. If you want to remove the %20's from a parameter value, you can try this:

 

 

set cmd [string map {%20 ""} [URI::query [string tolower [HTTP::uri]] " "] command]]

 

 

Just make sure to test the config load after you make the iRule change using 'b verify load' or 'tmsh load sys config verify'. There have been some parser bugs when loading the config with these types of commands. If you see any issues reply back here and I'll try giving you an alternate format to do the same thing.

 

 

Aaron
No RepliesBe the first to reply