Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

iRule help.

J_Aldrich
Altostratus
Altostratus

How do I connect these two iRule events together so that "ACCESS_POLICY_AGENT_EVENT" event occurs only when the "HTTP_REQUEST" event occurs? Any help would be greatly appreciated. See below:

 

when HTTP_REQUEST {

if { [http_uri] equals "/loginpage" }{

log local0. "LOGIN PAGE accessed by [IP::remote_addr]"

}

}

 

 

When ACCESS_POLICY_AGENT_EVENT {

if {something unique}{

log local0. "Something unique happened"

}

}

 

1 ACCEPTED SOLUTION

Hi J_Aldrich,

when HTTP_REQUEST {
	set status 0
	if { [HTTP::uri] equals "/loginpage" }{
		set status 1
		log local0. "LOGIN PAGE accessed by [IP::remote_addr]"
	}
}
 
when ACCESS_POLICY_AGENT_EVENT {
	if { $status } {
		log local0. "Status: $status"
		if { [ACCESS::policy agent_id] eq "example" } {
			# ...
		}
	}
}

View solution in original post

2 REPLIES 2

Hi J_Aldrich,

when HTTP_REQUEST {
	set status 0
	if { [HTTP::uri] equals "/loginpage" }{
		set status 1
		log local0. "LOGIN PAGE accessed by [IP::remote_addr]"
	}
}
 
when ACCESS_POLICY_AGENT_EVENT {
	if { $status } {
		log local0. "Status: $status"
		if { [ACCESS::policy agent_id] eq "example" } {
			# ...
		}
	}
}

J_Aldrich
Altostratus
Altostratus

This worked!!! Thank you so much!