conditionals
1 TopicBIG IP F5 IRule with data group to check if date has passed
Hello, I have a datagroup of kind string/external file, which has hosts on the first field, and dates with format YYYY-MM-DD on the second field. I want to create an irule that will do something when the date on the same row of the host has passed, or do something else if it doesn't. Example: "www.google.com" := "2020-04-16" In this case I want to do something, and if the date was 2024-11-25 I would want to do something else. Right now, it's not working for me, as I've tried with my Irule for a number of times. I am not even getting anything in the log. My irule: when HTTP_REQUEST priority 100 { if { not ( ( [IP::addr [IP::client_addr] equals 1.1.0.0%2/15]) or ( [IP::addr [IP::client_addr] equals 2.2.4.0%2/24]) or ( [IP::addr [IP::client_addr] equals 3.3.23.0%2/24]) or ( [IP::addr [IP::client_addr] equals 4.4.41.0%2/24]) or ( [IP::addr [IP::client_addr] equals 5.5.66.0%2/24]) or ( [IP::addr [IP::client_addr] equals 6.6.236.65%2/24]) or ( [IP::addr [IP::client_addr] equals 7.7.151.0%2/24]) or ( [IP::addr [IP::client_addr] equals 8.8.6.0%2/23]) or ( [IP::addr [IP::client_addr] equals 9.9.8.0%2/21]) or ( [HTTP::host] ends_with "co.il") or ( [HTTP::host] ends_with "sites.example.com") ) } { if { [string tolower [class match -name "[HTTP::host]" equals /Common/webrules_tal]] ne "" } { set expire_date [clock scan { class match -value equals /Common/webrules_tal }] log local0. "Got host address: [HTTP::host]" if { [clock seconds] < [clock scan { "$expire_date" }] } { HTTP::redirect "https://www.youtube.com" } } } } How can I do something like this in my Irule? Note: The IP address restriction above is to restrict by IP, these IP addresses are not mine, they're there just for this post. Thank you! Tal SabadiaSolved1.5KViews0likes1Comment