variable
8 TopicsBIG-IP : iRule test that variable exists and has certain value
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi What is the simplest most elegant syntax to test that a variable exists and has a certain value ? For example if I want to determine that myvariable exists and has non-zero value , is this the simplest syntax ? when HTTP_REQUEST { set myvariable 0 conditional processing ... set myvariable 1 more processing ... if {[info exists $myvariable] && [$myvariable]} { do something }3KViews0likes2CommentsSearch for a certain string or value in a session variable, modify it, and create a new session variable
I need to create a certain variable from some information i pull from someone's AD group. I am basically query AD for a users "memberOf" and this is what i get: | CN=__P-GBL-Software-ComputerName3-Extranet-ExternalAccess,OU=Container,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=Code Committee,OU=Distribution Groups,OU=Groups,OU=Acct_ABC,DC=company,DC=ccom | CN=__A-GBL-Dept-Switch-FULL,OU=Admins,OU=Acct_ABC,DC=company,DC=com | CN=__ABC Staff Lotto (Restricted),OU=Distribution Groups,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=__P-GBL-Pix-Loc-Special,OU=Software,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=__P-GBL-Pix-Role-Telehealth,OU=Software,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=__P-GBL-Pix-Loc-House Home Health,OU=Software,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=Talking Email,OU=Distribution Groups,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=ABC-MS-O365-E3-Reporting,OU=Azure,OU=Groups,OU=Acct_ABC,DC=company,DC=com | CN=__P-GBL-F5-Test,OU=Groups,OU=Acct_ABC,DC=company,DC=com | I need to pull the computer name from this long list and this value can be dynamic and the number "3" could be single digit or two digits like a "12". The value "Container" is unique and i think i can start here. I was hoping to find the string that contained "Container", then separate the vlues by "-" and from "-" take the values behind it. Example, first find the first string using "Container": CN=__P-GBL-Software-ComputerName3-Extranet-ExternalAccess,OU=Container,OU=Groups,OU=Acct_ABC,DC=company,DC=com Next separate by "-": CN=__P-GBL Software ComputerName3 Extranet ExternalAccess,OU=Container,OU=Groups,OU=Acct_ABC,DC=company,DC=com And create a variable using ComputerName3. I have looked the different "Split" and "lindex" commands but it can be a little confusing. Any help?511Views0likes3CommentsTMSH CLI to modify objects with keyword variables in them
I am curious if there was a way to modify VIPs w/o specifically defining them within the command .. for example : modify ltm virtual Test-Donkey-HTTPS profiles delete { tcp-600 } profiles add { tcp } modify ltm virtual Prod-Donkey-HTTPS profiles delete { tcp-600 } profiles add { tcp } modify ltm virtual Stage-Donkey-HTTPS profiles delete { tcp-600 } profiles add { tcp } So above, I would like to replace all "Donkey" VIPs in one shot to adjust their profiles. Thank you!499Views0likes1CommentiRule help for two redirects based off uri with variable
Hi, I'm trying to create an iRule that does the following redirects: http://xxx.com/ -> https://yyy.com/find-a-provider/ http://xxx.com/Home/Physician?profileId=UserValue -> https://yyy.com/find-a-provider/physician/UserValue The first redirect based on a uri of "/" is pretty straight-forward, but the second redirect that needs to repopulate the UserValue and tying it all together in one rule is where I'm struggling. Any suggestions greatly appreciated.Solved482Views0likes3Commentsirule development - fixed variables within iRule context
looking for some input how others are handling such a situation. with irule development you are often working with at least two irules in a certain environment (single bigip). of course multiple environments (dev, test, prod) is better but not always possible. so i have: irule (attached to most virtual servers) irule-new (attached to a single "test" virtual server) what i like is to have irule code which can be copied without any changes from irule-new to irule as the method "to put it into production". this of course causes issues when you have differences between the old and new environment surrounding the bigip. for example a new header, are different URI, .... another thing are "fixed" variables you use per irule, a debug level, a path, a pool. so variables you want to set once and then use through the whole irule. you can use static variables but these have a bigip wide effect, so that cant be used to have difference on iRule level. different static variables for the current and new irule are possible, but that means changing the irule code when moving to another irule. datagroups are an option, but those are also bigip wide. in some cases i use datagroups with a variable per host, but that doesnt scale very well. so how do you keep your variables within a single iRule context?399Views0likes3CommentsString Trim returning odd results
I am using a variable assign action in an APM policy to remove leading/trailing spaces from the username entered into the logon page. session.logon.last.username = expr { [string trim [mcget {session.logon.last.username}] ] } For the most part this works fine, but there are some usernames that being unexpectedly altered by this function. Note that all usernames are comprised of numbers, not letters. The following are some examples of how the username looks before and after this variable assign: 02045604 --> 543620 03276501 --> 884033 Any idea why this would be happening? Is the username variable possibly being treated as an integer instead of a string?349Views0likes1CommentBIG-IP : variable value in case set fails
f5 BIG-IP LTM VE v11.4.0 on ESXi tcl does not have a concept of null nil undefined So what value do variables assume in the case where the set operation fails to retrieve a value ? set param1 [URI::query [HTTP::uri] param1 ] What is param1 value for case where "param1=xxx" not present in query-string ? set cookie1 [HTTP::cookie value "cookie1"] What's cookie1 value for case where request doesn't contain cookie "cookie1" ?234Views0likes1Comment