About object naming convention in iRulesΒΆ

In BIG-IP Next, when you configure any iRule command that accepts a stack/virtual server or pool/l4serverside, it is essential to ensure that the object names follow the compatible naming convention. The object names are a combination of the parent object name, a prefix descriptor for the object, and the object name itself if it exists in the external API. The naming convention follows the template: /app/{app_name}/stack/{stack_name}, for a standalone pool, the naming convention follows the template: /app/{app_name}/pool/{stack_name}.

For example, consider an application with various components such as stacks, TCP profiles, and monitors:

{
    "description": Monitor Test Server",
    "domainName": "www.monitor_test.com",
    "name": "monitor_test_app",
     "stacks": [
         {
             "stackType": "HttpRevProxy",
             "name": "monitor_test_stack",
             "clientSide": {
                 "l4ClientSide": l4_cs_monitor_test_app,

                 "tcp": {

                      "template": "TCP_MODERN_TEMPLATE"

                  }
              },
             "serverSide": {
                  "l4ServerSide": l4_ss_monitor_test_app,
                  "loadBalancing": "weighted-round-robin",
                  "monitors": {http: {"interval": 5}},

                  "tcp": {

                       "template": "TCP_LAN_TEMPLATE"

                   }             

              },
        }
    ],
}
  • The name for the application is: /app/monitor_test_app.

  • The name for the stack is: /app/monitor_test_app/stack/monitor_test_stack.

  • The name for the clientside TCP profile is: /app/monitor_test_app/stack/monitor_test_stack/clientside/tcp.

  • The name for the serverside TCP profile is: /app/monitor_test_app/stack/monitor_test_stack/serverside/tcp.

  • When stacks generate more than one virtual server identified with sub names name1 and name2, the name for the stack with sub name name1 is: /app/monitor_test_app/stack/monitor_test_stack/name1, and the name for the stack with sub name name2 is: /app/monitor_test_app/stack/monitor_test_stack/name2.

  • When configuring arrays of clientsides and serversides, each indiviual clientside and serverside needs to be identified with a name. In the stack with two clientsides name1 and name2, the name for the stack with clientside name1 is: /app/monitor_test_app/stack/monitor_test_stack/clientside/name1, and the name for the stack with clientside name2 is: /app/monitor_test_app/stack/monitor_test_stack/clientside/name2.

Following example iRule commands are for reference:

when HTTP_REQUEST {
    virtual /app/monitor_test_app/stack/monitor_test_stack
  }
when HTTP_REQUEST {
  if { [HTTP::uri] starts_with "/redirectpool2" } {
    pool /app/monitor_test_app/stack/monitor_test_stack/l4serverside/l4_ss_monitor_test_app
  }
}
when CLIENT_ACCEPTED {
    log local0.info "Pass traffic to different pool"    pool /app/monitor_test_app/pool/monitor_test_stack
}