Irule
HI, i am new to irules . i am trying below irule
when LOAD_BALANCER_COOKIE_NAME = "SOURCE_IP";
public static String getRemoteIPAddress(HttpServletRequest request) { Cookie cookie = getCookie(request, LOAD_BALANCER_COOKIE_NAME); if (cookie == null) { return request.getRemoteAddr(); }
if (cookie.getValue() == null || StringUtils.isEmpty(cookie.getValue())) { return request.getRemoteAddr(); } return cookie.getValue(); }
i am seeing below errror
01070151:3: Rule [/Common/test] error: /Common/test:1: error: [wrong args][when LOAD_BALANCER_COOKIE_NAME = "SOURCE_IP";] /Common/test:3: error: [undefined procedure: public][public static String getRemoteIPAddress(HttpServletRequest request) { Cookie cookie = getCookie(request, LOAD_BALANCER_COOKIE_NAME); if (cookie == null) { return request.getRemoteAddr(); }
if (cookie.getValue() == null || StringUtils.isEmpty(cookie.getValue())) { return request.getRemoteAddr(); } return cookie.getValue(); }]
Can some one help me correcting the irule.