For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Aurel's avatar
Aurel
Icon for Cirrus rankCirrus
Aug 28, 2013

Remove characters from logging Irule entry

Hello,

 

I would like to remove the routing domain suffix "%1" in the log file i'm creating.

 

Here's a sample of my Irule.

 

when HTTP_REQUEST { set client_ip [IP::remote_addr] set log_msg "" append log_msg "$client_ip"

 

The result in the log file is "192.168.1.5%1" but i need to have it without the "%1". I'm wondering if a regex could do the job inside my Irule but i'm stucked in finding a way. Any help would be appreciated Aurel

 

19 Replies

  • Try this:

    set rd "%[ROUTE::domain]"
    set client_ip [string map "$rd \"\"" [IP::client_addr]]
    

    The biggest problem was that you were trying to evaluate variable substitution inside curly braces, which was treating $rd as a literal string.

  • Hi, This is doing the job : set rd "%[ROUTE::domain]" set client_ip [string map "$rd \"\"" [IP::remote_addr]]

     

  • Can anyone explain what the backslash is for? "$rd \"\""

     

    If this works: string map {%1 "" %2 "" %3 ""} [IP::client_addr]

     

    Why doesn't this work?: string map {$rd ""} [IP::client_addr]