Forum Discussion
Splunk for F5 Networks LTM v11 iRule
http://splunk-base.splunk.com/apps/50944/splunk-for-f5-networks
There is an install guide that I've followed very closely. I think that the problem is with the iRule that they suggest:
when CLIENT_ACCEPTED {
set client [IP::client_addr]
}
when HTTP_REQUEST {
set vhost [HTTP::host]:[TCP::local_port]
set url [HTTP::uri]
set method [HTTP::method]
set http_version [HTTP::version]
set user_agent [HTTP::header "User-Agent"]
set tcp_start_time [clock clicks -milliseconds]
set req_start_time [clock format [clock seconds] -format "%Y/%m/%d %H:%M:%S"]
set req_elapsed_time 0
set virtual_server [LB::server]
if { [HTTP::header Content-Length] > 0 } then {
set req_length [HTTP::header "Content-Length"]
HTTP::collect $req_length
} else {
set req_length 0
}
if { [HTTP::header "Referer"] ne "" } then {
set referer [HTTP::header "Referer"]
} else {
set referer -
}
}
when HTTP_REQUEST_DATA {
set req_elapsed_time [expr {[clock clicks -milliseconds] - $tcp_start_time}]
HTTP::release
}
when HTTP_RESPONSE {
set hsl [HSL::open -proto UDP -pool pool_syslog]
set resp_start_time [clock format [clock seconds] -format "%Y/%m/%d %H:%M:%S"]
set node [IP::server_addr]:[TCP::server_port]
set status [HTTP::status]
if { [HTTP::header Content-Length] > 0 } then {
set response_length [HTTP::header "Content-Length"]
} else {
set response_length 0
}
HSL::send $hsl "<190>|$vhost|$client|$method|\"$url\"|HTTP/$http_version|$user_agent|\"$referer\"|$req_start_time|$req_length|$req_elapsed_time|$node|$status|$resp_start_time|$response_length|$virtual_server"
}
I cannot get this to work as designed and I think it's because we're on v11
BIG-IP 11.1.0 Build 1943.0 Final
Has anyone figured out how to send this information to a logging server via an iRule (as suggested)?
Thanks
-Joe
- GavinW_29074NimbostratusJoe
- jbilbro_41390NimbostratusI'm having the exact same issue as nitass trying to get this setup on LTM v11 via the Splunk for F5 Networks included iRule. I see the health checks hitting Splunk (default send string) but nothing else, meaning it's not firewall related. I see usage on the iRule, but no usage on the syslog_pool. Anyone got any suggestions on troubleshooting this?
- hooleylistCirrostratusHi Jeff,
- jbilbro_41390NimbostratusThanks, you're right, that did the trick. Made a static route on a TMM switch port and all is well.
- opers13_3280NimbostratusI'm running version 9.4.8 and also trying to get f5 & Splunk to work. I tried creating the same iRule and I get the following error.
- What_Lies_Bene1CirrostratusI think the HSL::open command needs to be present in the CLIENT_ACCEPTED event rather than where it is in the rule posted.
- hooleylistCirrostratusHSL was added in 10.1:
- opers13_3280NimbostratusAaron Thank You! it's working fine..so since the syslog IP is on the irule now do I still need my syslog-ng config?
- opers13_3280NimbostratusPosted By hoolio on 11/09/2012 09:06 AM
what you I have to do to change the logging server from UDP to TCP?
Thanks Alex
- Mohamed_LrhaziAltocumulusMaybe here: https://support.f5.com/kb/en-us/solutions/public/8000/200/sol8259.html?sr=25334729
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com