RE: [syslog-ng] Newbie Looking for Help
Thanks for all the help I've received so far. Although, I'm still not able to do what I need to do. Right now, I just want to log one specific device to a specific log file. One email I received said I should use the netmask filter option, although for some reason, my system doesn't like that option. Here is the temp syslog-ng.conf I'm using. I have the full backed up, I just want to get this part working. Syslog-ng starts, but it doesn't actually log any thing. I cut this down so it would be easier to work with, although it's very possible that I cut out a required part of the log file. As of right now, I don't care if it logs any from the local system. I just need to log the pix device listed. Thanks in advance for any help, Mark # # Configuration file for syslog-ng under Debian # # attempts at reproducing default syslog behavior # the standard syslog levels are (in descending order of priority): # emerg alert crit err warning notice info debug # the aliases "error", "panic", and "warn" are deprecated # the "none" priority found in the original syslogd configuration is # only used in internal messages created by syslogd ###### # options options { # disable the chained hostname format in logs # (default is enabled) chain_hostnames(0); # the time to wait before a died connection is re-established # (default is 60) time_reopen(10); # the time to wait before an idle destination file is closed # (default is 60) time_reap(360); # the number of lines buffered before written to file # you might want to increase this if your disk isn't catching with # all the log messages you get or if you want less disk activity # (say on a laptop) # (default is 0) #sync(0); # the number of lines fitting in the output queue log_fifo_size(2048); # enable or disable directory creation for destination files create_dirs(yes); # default owner, group, and permissions for log files # (defaults are 0, 0, 0600) owner(root); group(root); perm(0644); # default owner, group, and permissions for created directories # (defaults are 0, 0, 0700) dir_owner(root); dir_group(root); dir_perm(0744); # enable or disable DNS usage # syslog-ng blocks on DNS queries, so enabling DNS may lead to # a Denial of Service attack # (default is yes) use_dns(no); # maximum length of message in bytes # this is only limited by the program listening on the /dev/log Unix # socket, glibc can handle arbitrary length log messages, but -- for # example -- syslogd accepts only 1024 bytes # (default is 2048) #log_msg_size(2048); }; # sources # all known message sources source s_all { # message generated by Syslog-NG internal(); # standard Linux log source (this is the default place for the syslog() # function to send logs to) unix-stream("/dev/log"); # messages from the kernel file("/proc/kmsg" log_prefix("kernel: ")); # use the above line if you want to receive remote UDP logging messages # (this is equivalent to the "-r" syslogd flag) udp(); }; #destinations for log files destination corppix_d { file ("/var/log/network/corppix/pix.log" owner (root) group (root) perm (0644) dir_perm (0744)); }; #filters filter corppix_f { netmask("10.10.10.2"); facility(local4); }; # logs log { filter(corppix_f); destination(corppix_d); };
On Fri, May 12, 2006 at 07:04:26PM -0400, Mark R. White wrote:
Thanks for all the help I've received so far. Although, I'm still not able to do what I need to do. Right now, I just want to log one specific device to a specific log file. One email I received said I should use the netmask filter option, although for some reason, my system doesn't like that option.
What version? I know that netmask() existed in 1.6.9, and current is 1.6.11. Perhaps you should start with a very tiny config file, like this: ------------------------------------------------------------------ source s_sys { udp( ip( 0.0.0.0 ) ); tcp( ip( 0.0.0.0 ) ); }; destination d_pix { file( "/var/log/pix.log" ); }; filter f_pix { netmask( "10.10.10.4" ); }; log { source(s_sys); filter(f_pix); destination(d_pix); } ------------------------------------------------------------------ If that still doesn't log anything, then run tcpdump on this host to prove that syslog packets *are* actually arriving, and the source address really is 10.10.10.4 (e.g. the PIX might be sending them with a loopback address as its source). Try: tcpdump -i eth0 -n -s1500 -v udp port 514 Note: if your machine has multiple IP addresses, then you can bind syslog-ng to a single one by changing 0.0.0.0 in the config above to that address. That allows you to run a traditional syslogd and syslog-ng simultaneously on the same machine, listing on different IP interfaces. HTH, Brian.
participants (2)
-
Brian Candler
-
Mark R. White