Forum Discussion
agentile_2106
Feb 01, 2011Nimbostratus
Array get and foreach statement HELP!
Hi Guys,
i'm going crazy with a simple array operation in a foreach statement. If i run:
when HTTP_REQUEST {
array unset colorcount
array set colorcount {
red 1
green 5
blue 4
white 9 }
foreach {color count} [array get colorcount] { log local0. "Color: $color Count: $count"}
i expect a reply "Color: red Count:1"
But on my logs i've got:
Feb 1 16:02:51 local/tmm info tmm[23012]: Rule IRULE-SMS-Sender-Rate : Color: blue Count: blue
Feb 1 16:02:51 local/tmm info tmm[23012]: Rule IRULE-SMS-Sender-Rate : Color: 4 Count: 4
Feb 1 16:02:51 local/tmm info tmm[23012]: Rule IRULE-SMS-Sender-Rate : Color: white Count: white
Feb 1 16:02:51 local/tmm info tmm[23012]: Rule IRULE-SMS-Sender-Rate : Color: 9 Count: 9
i've done this simple test because i'm wrinting an irule and i've recognized that the foreach statement on arrays seems not working!
Please, help
Regards
Tony
- hooleylistCirrostratusHi Tony,
- agentile_2106NimbostratusThanks Aaron,
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects