Forum Discussion
What_Lies_Bene1
Dec 17, 2012Cirrostratus
As with anything, experience and practise make things rather easier. So, just to be clear, you have created a Statistics Profile called 'mystats' and relevant counters with the names specified above and then assigned that profile to the Virtual Server yes? And everything matches case-wise? Remember everything is case sensitive with iRules.
Then you've tried something like this and it isn't working - note I've added some logging which might help and gone back to if statements?
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.120.0.0/16] } {
log local0. "Matched 10.120/16, incrementing Stats_GER"
STATS::incr mystats Stats_GER 1
}
elseif { [IP::addr [IP::client_addr] equals 10.110.0.0/16] } {
log local0. "Matched 10.110/16, incrementing Stats_CZ"
STATS::incr mystats Stats_CZ 1
}
else {
log local0. "Matched nothing, incrementing Stats_Other"
STATS::incr mystats Stats_Other 1
}
}