new to iRules
Hello, I am trying to create an iRule that uses a specific persistence profile if the incoming IP address is a member of a datagroup. I created the datagroup of type address and added my IPs. I'm trying to now create the iRule to use a hash persistence if the incoming IP address is a member of the data group and to use a source_addr persistence profile if not. Below is my iRule definition based on a datagroup of ABC:
when CLIENT_ACCEPTED { if { [matchclass [IP::remote_addr] equals $::ABC]} { persist hash } else { persist source_addr } }
When I try to save the iRule, I get the following error: 01070151:3: Rule [/ABC/ABC] error: /ABC/ABC:3: error: ["unexpected end of command;expected argument spec:ANY_CHARS"][persist hash]
what am I doing wrong? Thanks in advance
Your persist hash requires something to use as the hash.
https://devcentral.f5.com/wiki/iRules.persist.ashx
when CLIENT_ACCEPTED { if { [matchclass [IP::remote_addr] equals $::ABC]} { persist hash } else { persist source_addr } }