apm policy agent irule-event
apm policy agent irule-event(1BIG-IP TMSH Manuaapm policy agent irule-event(1)
NAME
irule-event - Manages an iRule Event agent.
MODULE
apm policy agent
SYNTAX
Configure the irule-event component within the policy agent module
using the syntax shown in the following sections.
CREATE/MODIFY
create irule-event [name]
modify irule-event [name]
options:
app-service [[string] | none]
id [[string] | none]
expect-data [[client-accepted] | [ssl-client-hello] | [ssl-cert-available] | [http] | [none]
edit irule-event [ [ [name] | [glob] | [regex] ] ... ]
options:
all-properties
non-default-properties
DISPLAY
list irule-event
list irule-event [ [ [name] | [glob] | [regex] ] ... ]
show running-config irule-event
show running-config irule-event [ [ [name] | [glob] | [regex] ] ... ]
options:
all-properties
non-default-properties
partition
show irule-event
show irule-event [name]
DELETE
delete irule-event [name]
DESCRIPTION
You can use the irule-event component to add a custom Access iRule
event to an access policy. This agent enables you to combine access
policy execution with iRule execution.
For example, you can retrieve the current agent ID (using an iRule
command ACCESS::policy agent_id ) to determine which of the iRule
agents raised the event and then perform some custom logic execution.
The Per-Request Policy's Access iRule event functions similarly to the
Access iRule event in the main access policy, but retrieval of the
current agent ID uses the iRule command "ACCESS::perflow get
perflow.irule_agent_id" to determine which of the iRule agents raised
the event.
The expect-data component is used in the Per-Request Policy when adding
an Access iRule event. You must specify the last piece of data that the
policy should wait for before raising the event. The default is HTTP.
EXAMPLES
when ACCESS_POLICY_AGENT_EVENT { if {[ACCESS::policy agent_id] eq
"lastLogon" } { # our limit in seconds set 2weeks 1209600 # diff in 100
nanosecond increments between MS time attribute (year 1601) and start
of epoch set offset 11644473600000 set adtime "[ACCESS::session data
get session.ad.last.attr.lastLogon]" # convert adtime to milliseconds
set millisecs [expr {$adtime / 10000}] # subtract offset set
lastlogintime [expr {$millisecs - $offset}] # convert to seconds
because milliseconds for 'now' were negative (maybe vmware issue) set
secs [expr {$lastlogintime / 1000}] set now [clock seconds] # finally
calculate the difference set diff [expr {$now - $secs}] log local0.
"lastLogon: $diff seconds from current time" if { $diff $2weeks } {
ACCESS::session data set session.custom.lastLogonWithin2Weeks 0 } else
{ ACCESS::session data set session.custom.lastLogonWithin2Weeks 1 } } }
>
In this example, ACCESS_POLICY_AGENT_EVENT gathers data containing
the users whose last logon was within the last two weeks. Note
that you can access session variables and create new session
variables inside this event.
list irule-event all
Displays a list of OAM agents.
delete irule-event my_irule_agent
Deletes the iRule Event agent named my_irule_agent.
OPTIONS
app-service
Specifies the name of the application service to which the object
belongs. The default value is none. Note: If the strict-updates
option is enabled on the application service that owns the object,
you cannot modify or delete the object. Only the application
service can modify or delete the object.
id Specifies the ID of the iRule event. The default is none. You can
use the ID to determine which agent caused the
ACCESS_POLICY_AGENT_EVENT. You can also use the ID to perform
different processing inside iRule for different agents.
[name]
Specifies the name of the component. This option is required.
partition
Displays the partition within which the component resides.
SEE ALSO
COPYRIGHT
No part of this program may be reproduced or transmitted in any form or
by any means, electronic or mechanical, including photocopying,
recording, or information storage and retrieval systems, for any
purpose other than the purchaser's personal use, without the express
written permission of F5 Networks, Inc.
F5 Networks and BIG-IP (c) Copyright 2011-2013, 2016. All rights
reserved.
BIG-IP 2017-11-28 apm policy agent irule-event(1)