Press "Enter" to skip to content

将经过F5的业务流量、HTTP访问URL、IP等信息发送到日志服务器上

Last updated on 2020-06-05

将经过F5的业务流量信心通过irules 的方式记录下来,并发送到日志服务器上。

when HTTP_REQUEST {
set rqst_time "[clock format [clock seconds] -format "%d/%b/%Y:%H:%M:%S %z"]"
set c_addr "[IP::client_addr]"
set vs_addr "[IP::local_addr]"
set url "[HTTP::host][HTTP::uri]"
}
when LB_SELECTED {
set snat_addr "[IP::local_addr]"
set s_addr "[LB::server addr]"
}
when HTTP_RESPONSE {
set rsps_time "[clock format [clock seconds] -format "%d/%b/%Y:%H:%M:%S %z"]"
set s_code "[HTTP::status]"
log 10.100.67.61 local5.info "
" log 10.100.67.61 local5.info "Srt_Time rqst_time Src_Ipc_addr Vs_Ip vs_addr URLurl Snat_Ip snat_addr Backend_Ips_addr Rsp_Time rsps_time Statuss_code" log 10.100.67.61 local5.info ""
}

when CLIENT_ACCEPTED {
set hsl [HSL::open -proto UDP -pool syslog_server_pool]
}
when HTTP_REQUEST {
# Log HTTP request as local7.info; see RFC 3164 Section 4.1.1 - "PRI Part" for more info
HSL::send $hsl "<190> [IP::local_addr] [HTTP::uri]\n"
}

第一irules是记录,第二个是发送,需要结合起来使用。

需要远程协助请加博主微信,谢谢。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

2 × 1 =