Forum Discussion
Nathaneil0227_2
Mar 22, 2016Nimbostratus
iRule for HSL or logging etc
Hi Devcentrallers,
Do you have an iRule that will send logs with timestamp, clientIP, poolmember, vs that also have a condition if fails/success?
Any reply would be appreciated.
VernonWells
Employee
If you add the http profile to a Virtual Server that is receiving non-HTTP traffic, that traffic flow will fail (because the HTTP parser will reject the traffic). On the other hand, if you believe the traffic is in fact HTTP, then one of three things is happening:
- the traffic is malformed HTTP (in which case the HTTP parser rejects the message);
- the HTTP traffic violates http profile configured protections (for example, there is a maximum header size limit that is configurable on the profile. If a message is received with headers exceeding the limit, the message is dropped);
- you are encountering a bug (in which case, you should open a support case).
At any rate, as I mention above, you can log any arbitrary traffic by using the CLIENT_ACCEPTED, LB_SELECTED or SERVER_CONNECTED events, all of which happen on any full-proxy connection. For example:
when LB_SELECTED {
set hsl [HSL::open -publisher your_publisher]
HSL::send $hsl "[clock format [clock seconds]] [IP::client_addr] [LB::server name] [clientside {IP::local_addr}]:[clientside {TCP::local_port}]"
}
This assume the traffic is TCP. If it is UDP, the change each instance of
TCP::
to UDP::
.Nath
Mar 25, 2016Cirrostratus
Hi Vernon, but isnt it we need http profile to have an iRule?
I really appreciate you buddy. Thanks.
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects