Hello friends, syslog-ng version “” syslog-ng-2.1.4-1.el5"" I am currently trying to redirect all .log files to syslog centralize server. Any idea can I redirect all files in one directory with .log extension to syslog with syslog-ng? I did try this script but it work for one file not for all directories. #source s_file_subdirectories { file(“”/tmp/commands/.log"" # for whole directory does not work source s_file_subdirectories { file(“”/tmp/commands/.log"" ## for one file does work recursive(yes) follow_freq(1) log_fetch_limit(100) );}; destination d_messages{ file(“”/var/log/commands"“); }; log { source(s_file); destination(d_messages); }; source s_commands { file(”“/var/log/commands”" follow_freq(1)); }; destination shell { tcp("“1.1.1.1"” port(514)); }; log { source(s_commands); destination(shell); };

I have multiple log files with .log extension in one directory, I want to redirect all of them and some.

How can I forward. I am aware how to forward to remote server but here I have different problem. I want to send one whole directory logs, and all files have different name but extension is same (.log).

Thanks!

You have to edit /etc/syslog.conf file on the server where you want to transfer their logs to central log server.

just do following , syslog-ng server ip is 10.10.2.3 in my case

#vim /etc/syslog.conf

local.* @10.10.2.3

Thanks Craig for your reply but my question is totally different, I want to redirect all .log extension file to centralised syslog server using syslog-ng.

i.e

/var/log/logdir/scriptx. log
/var/log/logdir/scripty.log and so on different names before .log

Is that possible I can send all log files with one configuration through syslog-ng. I do not want to put any filter on log file

Thanks!

perhaps your script was clipped while trying to post it,
but I was thrown off by what seems a mis-matched closing paran in middle of

log_fetch_limit(100)
);};

the remainder of your logic is also a bit cryptic

if this is your first attempt at using syslog-ng,
then start with a much simple config and build-up/alter config after success at each step

the stumbles are easier to recover from (let alone avoid) when you start out walking a bit slower

if you have been using utility for awhile, then it should be easy to back-up to last simpler usage

final suggestion tonight
rather than just posting code which may be clear to you,
try stating your goals in simple comment style terms of just a few lines