LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-09-2012, 08:39 AM   #1
MattSong
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Rep: Reputation: Disabled
Question [syslog-ng] Could I Set variables like $YEAR at source{} ?


Hi guys

I am new to syslog-ng and confused on syslog-ng.conf

here is the issue:

I got couple windows 2K3 server running some .net program, each server will generate a log named like "20120109.log" (YYYYMMDD). I need to collect all those log with syslog-ng, I have installed syslog-ng by CYGWIN, and below is my .conf file:


options {
keep_hostname(no);
chain_hostnames(no);
owner("root");
group("root");
perm(0664);
sync(0);
};

source test_logs

{
file("/cygdrive/d/logs/${YEAR}${MONTH}${DAY}.log"
follow_freq(1)
);

};

destination log_center {
tcp("[remoteIP]" port(5140));
};

log {
source(test_logs);
destination(log_center);
};


but I find that the variable like $YEAR at souce{} didn't work at all, if I replace ${YEAR}${MONTH}${DAY}.log with 20120109.log then its works fine.


Anybody got any idea B-)?


Thanks
Matt
 
Old 01-09-2012, 09:00 AM   #2
balabit
syslog-ng documentation maintainer at BalaBit
 
Registered: Jun 2009
Posts: 16

Rep: Reputation: 2
Hi,

unfortunately the open source edition of syslog-ng cannot currently follow multiple files in a source, macros do not work in file-source pathnames.

Regards,

Robert Fekete
BalaBit
http://www.balabit.com/network-security/syslog-ng
 
1 members found this post helpful.
Old 01-09-2012, 09:07 AM   #3
MattSong
LQ Newbie
 
Registered: Jan 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by balabit View Post
Hi,

unfortunately the open source edition of syslog-ng cannot currently follow multiple files in a source, macros do not work in file-source pathnames.

Regards,

Robert Fekete
BalaBit
http://www.balabit.com/network-security/syslog-ng

All Right, I will try anohter way...

Thanks Robert
 
Old 01-10-2012, 11:06 AM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.0
Posts: 1,336

Rep: Reputation: 255Reputation: 255Reputation: 255
Maybe you could use a cron job to generate a syslog-ng.conf file on the fly with two entries for the logfile of today and tomorrow as you know their names. And each day at noon you prepare for the next day.

Just note, that in the commercial license you also get a Windows client and you donít need cygwin any longer to send messages to a remote server.
 
Old 01-11-2012, 03:27 AM   #5
balabit
syslog-ng documentation maintainer at BalaBit
 
Registered: Jun 2009
Posts: 16

Rep: Reputation: 2
"Just note, that in the commercial license you also get a Windows client and you donít need cygwin any longer to send messages to a remote server."

That's right, and the commercial windows client can automatically follow multiple files/directories.

You can find more information about that on the syslog-ng website at http://www.balabit.com/network-secur...dows_eventlog/ or in its documentation.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to set time to generate new /var/syslog brgsousa Linux - Software 2 10-26-2010 10:01 AM
Send a UDP Syslog packet with Source Port set to 514 fjkum Programming 1 01-26-2010 04:53 PM
Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables) senthilpr_in Linux - Newbie 4 02-26-2007 01:46 PM
syslog.conf -->how to set boot.log? taiwf Ubuntu 1 03-10-2006 01:58 PM
How do I set up Syslog jpflager Linux - Software 1 03-04-2003 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration