Forum Discussion
Wouter_de_Bruin
Nimbostratus
Jul 09, 2008Can I change default syslog facilities? (9.4.3)
Hello,
is there a way to change the default syslog facilities?
We have an external syslog server (Not managed by us, of course;-) which only forwards facilty 7 messages to the log files we are authorised to use. Yes, I know, it should be different, but its not a perfect world :-(
I know exactly which log events I'd like to forward to this server, but they have different facilities. I would like to change the facility of these messages to 7 before they are sent to the external server.
I had a look at "b syslog" but this doesn't seem to do the thing for me.
We are running LTM with 9.4.3
Any help appreciated.
Wouter de Bruin
- JRahm
Admin
Yes, syslog-ng can be setup to do this. Please reference this tech tip and post back if you have any questions. - nitass
Employee
could u pls try this? let us know if it doens't work. - geffryti_32102
Nimbostratus
Thanks Nitass.b syslog include '" local3.* /var/log/asm filter f_local3a { facility(local3); }; destination d_asmtest { file("/var/log/custom/asm_log_file" template("<190>$DATE $HOST $MSGHDR$MSG\n"; template_escape(no))); }; log { source(local); filter(f_local3a); destination(d_asmtest); }; "' BIGpipe parsing error: 012e0022:3: The requested value (/var/log/custom/asm_log_file") is invalid (show | ( | none)) for 'include' in 'syslog'
b syslog include '" local3.* /var/log/asm filter f_local3a { facility(local3); }; template t_asm { template("<190> $DATE $HOST $MSGHDR$MSG\n"); template_escape(no); }; destination d_asmtest { file("/var/log/lost+found/output/testasmlog" template(t_asm)); }; log { source(local); filter(f_local3a); destination(d_asmtest); }; "' BIGpipe parsing error: 012e0022:3: The requested value (<190> $DATE) is invalid (show | | none) for 'include' in 'syslog'
- nitass
Employee
can u put backslash (\) in front ot double quote (")? - geffryti_32102
Nimbostratus
Yup, that fixed it. Below is the working config.b syslog include '" local3.* /var/log/asm filter f_local3a { facility(local3); }; template t_asm { template(\"<190> $DATE $HOST $MSGHDR$MSG\n\"); template_escape(no); }; destination d_asmtest { file(\"/var/log/lost+found/output/testasmlog\" template(t_asm)); }; destination d_loghost5a { udp(\"10.2.2.2\" port (514)); }; log { source(local); filter(f_local3a); destination(d_asmtest); destination(d_loghost5a); }; "'
<190> Jun 14 06:51:51 blah blah blah blah blah
- nitass
Employee
this is mine.b syslog include '" filter f_local3a { facility(local3); }; template t_asm { template(\"<190> $DATE $HOST $MSGHDR$MSG\n\"); template_escape(no); }; destination d_loghost5a { udp(\"192.168.206.96\" port (514) template(t_asm)); }; log { source(local); filter(f_local3a); destination(d_loghost5a); }; "'
- geffryti_32102
Nimbostratus
Appreciate your help Nitass... it's working now... below is my working code....b syslog include '" filter f_local3a { facility(local3); }; template t_asm { template(\"<190> $MSGHDR$MSG\n\"); template_escape(no); }; destination d_loghost5a { udp(\"2.2.2.2\" port (514) template(t_asm)); }; log { source(local); filter(f_local3a); destination(d_loghost5a); }; "'
- nitass
Employee
thanks for update and glad to hear it works now. :-) - JRahm
Admin
Nice work, guys! I wrote up your solution: - efftee_26336Historic F5 AccountThe equivalent tmsh syntax is modify sys syslog include "filter f_local3a { facility(local3); }; template t_asm { template(\"<190> $DATE $HOST $MSGHDR$MSG\\n\"); template_escape(no); }; destination d_loghost5a { udp(\"2.2.2.2\" port (514) template(t_asm)); }; log { source(local); filter(f_local3a); destination(d_loghost5a); }; " and if you want to log every message into one remote syslog facility I used this CLI modify sys syslog include "template t_asm { template(\"<190> $DATE $HOST $MSGHDR$MSG\\n\"); template_escape(no); }; destination d_loghost5a { udp(\"10.255.0.1\" port (514) template(t_asm)); }; log { source(local); destination(d_loghost5a); }; "
- Hem_66900
Cirrus
This command does not work fine.Please help.
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