Forum Discussion

afedden_1985's avatar
Oct 02, 2012

External data Group URI hit counts

Does anyone know a way to get URI hit counts when using external data groups in version 11.2.0. We have a VIP with 100s of applications and about 100 pools. We use an external data group where we map all the URIs to pools and and we use an iRule on the VIP to make the layer 7 decision to search the data group to find a URI match and the pool to use for the request. The L7 iRule and external data group work well but we have no way of seeing how many hits any particuliar URI to pool map might have. As applications deploy and retire they don’t alwaus clean up their mess and leave many orphaned mapping records in the External data group file. Without knowing if the URI has any hits we don’t know if its still needed or still being used.

 

If anyone has an easy way to get this type of hit count I’m interested in hearing how to do it.

 

Here is an example of the external data group records or where they would be if you used them

 

From 11.2 GUI go to system> File Management > Data Group file list select the external data group file

 

The list starts with the URI then to the right the pool name to use for the URI. We want to know how many times each of these records gets a hit.

 

"/APP1" := "POOL1",

 

"/APP2/" := "POOL1",

 

"/FORM1/" := "POOL2",

 

"/APP3" := "POOL3"

 

"/SALES/" := "POOL2",

 

  • is istats applicable?

    Introduction to iStats Part 1: Overview by Colin

    https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1088514/Introduction-to-iStats-Part-1-Overview.aspx

    e.g.

    [root@ve11a:Active:Changes Pending] config  tmsh list ltm virtual bar
    ltm virtual bar {
        destination 172.28.19.252:80
        ip-protocol tcp
        mask 255.255.255.255
        profiles {
            http { }
            tcp { }
        }
        rules {
            myrule
        }
        snat automap
        vlans-disabled
    }
    [root@ve11a:Active:Changes Pending] config  tmsh list ltm pool foo1
    ltm pool foo1 {
        members {
            200.200.200.101:80 {
                address 200.200.200.101
            }
        }
    }
    [root@ve11a:Active:Changes Pending] config  tmsh list ltm pool foo2
    ltm pool foo2 {
        members {
            200.200.200.102:80 {
                address 200.200.200.102
            }
        }
    }
    [root@ve11a:Active:Changes Pending] config  tmsh list ltm data-group external uri_class
    ltm data-group external uri_class {
        external-file-name uri_class_file
        type string
    }
    [root@ve11a:Active:Changes Pending] config  cat /config/filestore/files_d/Common_d/data_group_d/\:Common\:uri_class_file_1
    "/app1" := "foo1",
    "/app2/" := "foo2",
    [root@ve11a:Active:Changes Pending] config  tmsh list ltm rule myrule
    ltm rule myrule {
        when HTTP_REQUEST {
       set uri [string tolower [HTTP::uri]]
       if {[class match -- $uri starts_with uri_class]} {
          ISTATS::incr "ltm.virtual /Common/bar counter [class match -name $uri starts_with uri_class]" 1
          pool [class match -value $uri starts_with uri_class]
       }
    }
    }
    
     istats is in User-defined section.
    
    [root@ve11a:Active:Changes Pending] config  tmsh show ltm virtual bar
    
    ---------------------------------------------------------
    Ltm::Virtual Server: bar
    ---------------------------------------------------------
    Status
      Availability     : unknown
      State            : enabled
      Reason           : The children pool member(s) either don't have service checking enabled, or service check results are not available yet
      CMP              : enabled
      CMP Mode         : all-cpus
      Destination      : 172.28.19.252:80
    
    Traffic                    ClientSide  Ephemeral  General
      Bits In                      474.0K          0        -
      Bits Out                     916.1K          0        -
      Packets In                      795          0        -
      Packets Out                     790          0        -
      Current Connections               0          0        -
      Maximum Connections             100          0        -
      Total Connections               158          0        -
      Min Conn Duration/msec            -          -        8
      Max Conn Duration/msec            -          -     2.0K
      Mean Conn Duration/msec           -          -     2.0K
      Total Requests                    -          -      158
    
    CPU Usage Ratio (%)
      Last 5 Seconds                    0
      Last 1 Minute                     0
      Last 5 Minutes                    0
    
    User-defined  Value
      /app1   101
      /app2/   51