Forum Discussion

MDPF52_180608's avatar
MDPF52_180608
Icon for Nimbostratus rankNimbostratus
Jan 29, 2015

iRule capture URI Parameter

Hello DevCentral,

 

I need to catch a parameter from a certain URI i must capture the number sequence in the following pattern and insert it in a variable:

 

/uri?value=_randomtag&_1422548345515=

 

Captured value: 1422548345515

 

Thanks in Advance,

 

Best Regards,

 

M.

 

2 Replies

  • I would suggest looking at the tcl scan command to get started. If I get a little time, I'll try to give you an example you can use, but wanted to at least suggest a starting point. (Otherwise regex may work, but it's much less efficient)

     

  • Here's an example that based on the

    scan
    command that worked in my testing

    set isFound [scan $a {%[^&]&_%d%s"} x c x]
     x == garbage. no need to do anything with it
     c == the ID string
    

    If you have trouble, these two pages help explain as well: here and here