Logging, Syslog and Log Anaylsys Forums
July 30, 2010, 09:40:13 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
   Home   WIKI BLOG Help Search Recent Topics GoogleTagged Login Register  
Pages: [1]
  Print  
Author Topic: $YEAR, $MONTH & $DAY in file source  (Read 636 times)
scusting
Newbie
*
Offline Offline

Posts: 1


View Profile
« on: February 23, 2010, 08:10:23 am »

Hi,

I'm trying to use syslog-ng to follow a file and syslog this data to a remote syslog server.  I have my source defined as such:


source s_tail_radius {
    file("/data/log/radius-$YEAR$MONTH$DAY" follow_freq(1) flags(no-parse));
};


However it doesnt seem to be using the date variables to find this file:

Feb 23 12:01:24 syslog-ng[19582]: Follow-mode file source not found, deferring open; filename='/data/log/radius-$YEAR$MONTH$DAY'

Is it possible to specify these variables in the source definition?

Thanks.

Jim.
Logged
Admin
Administrator
Newbie
*****
Offline Offline

Posts: 146


View Profile WWW
« Reply #1 on: February 23, 2010, 08:19:46 am »

The $YEAR, $MONTH, $DAY, etc variables are populated with the their respective values from a log, and so are only valid in the context of a destination function.  The only thing I can think to do is have radius log to a standard file, such as "/data/log/radius.log", then have the logs rotated as needed.  That way, you can have syslog-ng read from /data/log/radius.log.
Logged
balabit
Newbie
*
Offline Offline

Posts: 4


View Profile Email
« Reply #2 on: March 09, 2010, 07:14:43 am »

Hi, what you are looking for is using wildcards in the filename (http://www.balabit.com/dl/html/syslog-ng-v3.0-guide-admin-en.html/ch03s03.html#configuring_sources_file), but this feature is currently available only in the commercial syslog-ng Premium Edition.
Logged
Pages: [1]
  Print  

 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!