Forum Discussion
jacob900_39797
Nimbostratus
May 09, 2007logging to a file other than syslog??
Is there a command or example available that shows how to log information to a file other than syslog? I am working on a stats profile and would like to save the information in a specifically named file, csv style would be even better.
Thanks..
- JRahm
Admin
I like that line of thinking on 3, Joe... - Deb_Allen_18Historic F5 Accounthoolio posted this great solution for logging selected data to alternate files via the default iRules facility by setting up appropriate filters and destinations: http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&forumid=5&postid=8888
set up filter to log only messages from rule_A to LogA local0.* /var/log/LogA filter f_LogA { facility(local0) and match("rule_A"); }; destination d_LogA { file("/var/log/LogA" create_dirs(yes)); }; log { source(local); filter(f_LogA); destination(d_LogA); }; set up filter to log only messages from rule_B to LogB local0.* /var/log/LogB filter f_LogB { facility(local0) and match("rule_B"); }; destination d_LogB { file("/var/log/LogB" create_dirs(yes)); }; log { source(local); filter(f_LogB); destination(d_LogB); }; optionally modify default LTM log section to exclude those entries local0.* /var/log/ltm filter f_local0 { facility(local0) and level(info..emerg) and not match("rule_A") and not match("rule_B"); }; destination d_ltm { file("/var/log/ltm" create_dirs(yes)); }; log { source(local); filter(f_local0); destination(d_ltm); };
at the command line.bigstart restart syslog-ng
bigstart startup syslog-ng
- Deb_Allen_18Historic F5 Account***NOTE: The above config is a PARTIAL syslog-ng.conf file. DO NOT replace your existing syslog-ng.conf file with only the above snip, or you will not be logging and alerting on a number of critical LTM functions.
- jacob900_39797
Nimbostratus
Thanks everybody for all the replies. I think i have enough info to begin this project. Thanks again...
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