Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My syslog-ng.conf:

@version: 3.0
# Default configuration file for syslog-ng.
# For a description of syslog-ng configuration file directives, please read
# the syslog-ng Administrator's guide at:

options {
flush_lines (0);
time_reopen (10);
log_fifo_size (10000);
use_dns (no);
use_fqdn (no);
create_dirs (no);
keep_hostname (yes);
ts_format (rfc3164);

# sources
source s_local {
# message generated by Syslog-NG
# standard Linux log source (this is the default place for the syslog()
# function to send logs to)
# messages from the kernel
file("/proc/kmsg" program_override("kernel: "));

source all_tcp { tcp(ip( port(1470));

source all_udp { udp(ip( port(514));

# destinations
destination d_messages { file("/var/log/messages"); };
destination d_perf_test { file("/apps/logs/syslog_ng/perf_test.1"); };
destination d_prod { file("/apps/logs/syslog_ng/prod.1"); };
destination d_dr { file("/apps/logs/syslog_ng/dr.1"); };

destination d_covad { file("/apps/logs/syslog_ng/covad.1"); };

filter f_perf_test { (host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( host( or host( or host( or host( or host( or host( or host(; };

filter f_prod { (host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host(; };

filter f_dr { (host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host( or host(; };

filter f_covad { (host( or host(; };

log { source(s_local); destination(d_messages); };

log { source(all_udp); filter(f_perf_test); destination(d_perf_test); };
log { source(all_udp); filter(f_prod); destination(d_prod); };
log { source(all_udp); filter(f_dr); destination(d_dr); };

log { source(all_udp); filter(f_covad); destination(d_covad); };


Syslog-ng was able to capture all other sources except and with destination of f_covad

Question: Is my configuration correct? Are there any other options that might benefit to troubleshoot this problem?

How do I check whether my NIC is receiving the log from covad source?

How do I check whether syslog-ng is listening and able to read the syslog message from covad address?

Any help will be appreciated.

share|improve this question

In the past I have opted to quote IP addresses as part of the host section of a filter string. So using this as an example you should make the following changes:

filter f_covad { (host("") or host("")); };

Otherwise I see nothing wrong with your config. Next you should check your host firewall to see if UDP port 514 is open from your log sources. Next after that is seeing if the logs are even making it that far. What I often like to do for testing reception of syslog traffic is to simply use tcpdump. It will parse the message and display the appropriate data. For example:

packs@ node1:~> sudo tcpdump -i eth0 port 514
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
13:53:35.633091 IP > node1.local.syslog: SYSLOG, length: 688
13:53:35.646322 IP > node1.local.syslog: SYSLOG, length: 204
13:53:35.654178 IP > node1.local.syslog: SYSLOG, length: 204

This gives us all the information we need to see if the messages are even getting to the host.

share|improve this answer
Based on tcpdump, syslog is received by NIC. When I use wildpackets, it contains the syslog message using port udp514. Is there a way of looking raw log from NIC or possibly a debug method? – pewter groffom Feb 20 '13 at 19:06
tcpdump attaches outside the host firewall. You can use -j LOG in iptables to verify which chain and which rules a packet might be mathcing. You can use strace to verify that the logs actually reach syslog-ng after they have passed the firewall and strace will follow this through all the way to the filesystem. It might be good to filter the strace output to just strace -e trace=file,network. – Ladadadada Feb 20 '13 at 22:01
@Ladadadada: I probably should have spelled out why I use tcpdump after checking the firewall config. strace is a great tool, but gods is is annoying to dig through. – Scott Pack Feb 20 '13 at 22:50

I like to organise my syslog-ng config slightly differently so that each log definition has flags(final); like this:

log { source(s_src); filter(f_auth); destination(d_auth); flags(final); };

This allows me to have a "catch all" log at the bottom of the config.

destination d_catchall { file("/var/log/$YEAR/$MONTH/catchall.$DAY.log" template("$DATE $FULLHOST $PROGRAM $MSG\n") template_escape(no)); };
#filter f_catchall { not host(""); };
#log { source(s_src); filter(f_catchall); destination(d_catchall); };
log { source(s_src); destination(d_catchall); };

Anything that isn't explicitly logged earlier in the file is logged in the catchall log. This means I never drop any logs on the floor. It's surprisingly easy to not match the correct program or tag name or use host-based names when a DNS entry is missing or simply mistype an IP address.

The two commented out lines you can see there are for when I do need or want to ignore some logs, such as when some service is logging at the debug level but I don't actually want to store all those logs.

share|improve this answer
Solved the problem. I used the debug tool that syslog-ng provide by executing syslog-ng -Fevd and output it in a file. In that file, you can see how syslog-ng receives syslog from the device and filter based on the filters that you set up. – pewter groffom Feb 22 '13 at 17:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.