Forum Discussion
ramann_75062
Nimbostratus
Mar 09, 2009Log to a seperate log file
Hi @all,
I want to log data in a iRule to another log file as the "normal" log file ltm - is this possible?
Thanks
Bjoern
hoolio
Cirrostratus
Mar 16, 2009You would need to log from the iRule to a valid syslog-ng facility (local0. - local7). What you'd normally do is configure a custom syslog-ng filter and destination so that if the log string from the iRule matches the filter, the log statement would be written to the destination.
Here is an example of logging any statement sent to local0.info containing a string "logging" to a remote syslog server. You could modify this to use a custom local file using the destination you've created in your last post.
http://devcentral.f5.com/wiki/default.aspx/iRules/LogHttpTcpUdpToSyslogng.html
local0.info send logging entries to remote syslog server
filter f_local0.info {
facility(local0) and level(info) and match("logging");
};
destination can be a hostname or IP address
destination d_logging {
tcp("syslog.myhost.com" port (5000));
};
log {
source(local);
filter(f_local0.info);
destination(d_logging);
};
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
