Forum Discussion
Michael_Koyfma1
Cirrus
Apr 14, 2006Concatenate two values into one
I need to ocncatenate two values into one variable and separate them by a :
Basically, I need to build a string/variable that looks like clientaddress:clientport. I've tried to enter this in the iRule:
set srctoken [concat [IP::addr] [TCP::client_port]]
However, when I try to save the iRule, I get an error that says [wrong args] [IP::addr]
Also, I can't seem to figure out what's the proper way to insert a ":" betweent he argument. If the client's IP address is 10.1.1.1 and destination port is 80, then I need to create a string that looks like 10.1.1.1:80
Any help is greatly appreciated.
-Michael
- Colin_Walker_12Historic F5 AccountOh, as to your second question, you can try just setting the variable, rather than using concat, if you want to add something in between the two values.
set myVar [IP::client_addr] + ":" + [TCP::client_port] or set myVar "[IP::client_addr] : [TCP::client_port]"
- brad_11480
Nimbostratus
i get a syntax error trying to do something like: - hoolio
Cirrostratus
Hi Brad,
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