Forum Discussion

kend's avatar
kend
Icon for Nimbostratus rankNimbostratus
Sep 18, 2020

Create iRule in TMSH

I am trying to use TMSH to create a new iRule. I am using the syntax below. It creates the iRule and adds the definition, but when you look at the iRule in the GUI, there are extra quotes added where the \r is in the syntax. Why are those quotes showing up and how do I change the syntax so they don't appear?

 

Syntax

tmsh create ltm rule pool_redirect `echo -e "when CLIENT_ACCEPTED { # If the pool_rdp is down, redirect to pool_2_rdp \r if { [active_members pool_rdp] < 1 } { pool pool_2_rdp return }}"`

 

iRule in GUI after created in TMSH (the two sets of quotes after pool_2_rdp should not be there)

when CLIENT_ACCEPTED { # If the pool_rdp is down, redirect to pool_2_rdp "

" if { [active_members pool_rdp] < 1 } { pool pool_2_rdp return }}

1 Reply

  • I'm doing some testing in my lab right now to figure this out. Right away I can tell you that it's the "-e" flag on echo that is introducing them when it interprets the \r.