How to: Manage HSL log publishers in iRules¶
About HSL log publishers in iRules¶
The HSL log publishers in iRules allow you to send data to a pool of servers through High Speed Logging (HSL). HSL is designed as a low-overhead mechanism to send traffic logs at high volumes, and supports TCP and UDP protocols and remote syslog and Splunk formats. For more information, refer to How to: Manage HSL Log Publishers.
The HSL requires the use of routes and a route must be in place to send HSL traffic through switch port interfaces. Routing through the management interface is not supported and will not work.
Manage HSL log publishers in iRules¶
Prerequisite
Create required HSL log publishers in application services. For more information, refer to How to: Manage HSL Log Publishers.
Familiarize with HSL iRule commands.
Use this task to manage HSL log publishers in iRules:
Log in to BIG-IP Next Central Manager, click the Workspace icon next to the F5 logo, and then click Applications.
On the left, click iRules. The list of iRules is displayed. If no iRules are available, refer Create an iRule to add iRules.
Click on the iRule name. The iRule properties will be displayed.
Select HSL Log Publishers on the left. The HSL Log Publishers panel displays the list of associated publishers. If no publisher is associated with the iRule, use the Add Publisher to select the required HSL log publishers.
Note: The selected HSL log publishers are deployed with every application that uses the iRule.
Click Save.
The following are iRule examples with HSL log publisher name reference:
when CLIENT_ACCEPTED {
set hsl \[HSL::open -proto UDP -pool syslog\_server\_pool\]
}
when HTTP_REQUEST {
# Log HTTP request via syslog protocol as local7.info; see RFC 3164 for more info
HSL::send $hsl "<190> \[IP::local_addr\] \[HTTP::uri\]\\n"
}
when CLIENT_ACCEPTED {
set my_hsl \[HSL::open -publisher </partition>/<log publisher>\]
}
when HTTP_REQUEST {
HSL::send $my_hsl "Request: \[HTTP::host\]\[HTTP::uri\]"
log local0.info "Request: \[HTTP::host\]\[HTTP::uri\]"
}
when CLIENT_CLOSED {
unset my_hsl
}