Forum Discussion
How to enable logs on LTM if http profile is not used
Hi,
Can anyone help me how can we enable logging through irule in case HTTP profile not enabled in one VIP configuration in LTM. Need valuable help.
Regards Papdheen M
5 Replies
- Henrik_Gyllkran
Nimbostratus
What exactly is it that you want to log? You could capture the payload of the packets with TCP::collect and then send it a syslog server with HSL. It's a bit messy but it might fulfil your requirements.
- babudheen_72823
Nimbostratus
Hi Henrik,
Can you provide more details about HSL and how I can achieve this using HSL. As I not much familiar with HSL, I am expecting some sort of help from you.
Regards Babu
- Henrik_Gyllkran
Nimbostratus
HSL, or High Speed Logging is as feature to allow for syslog messages to be sent directly from TMM. We can use this in iRules among other things. HSL is described in the iRules wiki here on devcentral:
https://devcentral.f5.com/wiki/iRules.HSL.ashx
As for how to do this, you didn't specify exactly what you want to log from the traffic so it's kind of hard to say. Can you provide more information?
- babu_7813
Nimbostratus
Hi Henrik,
Thanks for the update. Can you give me more details how i can enable for one particular VIP to send logs using HSL?
Regard Babu
- Kevin_Stewart
Employee
There's a few ways to do this:
-
An iRule - if you want to be very specific about what you log, you can issue an HSL log statement within an iRule. Example:
when CLIENT_ACCEPTED { set hsl [HSL::open -proto UDP -pool syslog-pool] } when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/app1*" { HSL::send $hsl "<134>User accessing /app1 from [IP::client_addr]" } "/app2*" { HSL::send $hsl "<134>User accessing /app2 from [IP::client_addr]" } } } -
A request logging profile - under Local Traffic - Profiles - Other - Request Logging, create a request logging profile that details what data you want captured and what syslog pool you want it sent to. This is quite a bit more brute force than the iRule approach, so maybe not entirely what you're looking for. Here's some additional information on the request logging profile nonetheless:
-
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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