LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-29-2008, 06:26 AM   #1
ksri07091983
Member
 
Registered: Nov 2007
Location: Chennai,TamilNadu,India
Distribution: RedHat,SuSE
Posts: 65

Rep: Reputation: 15
syslog-ng with "template" option


hi all,

I am trying to log certain types of messages(like errors and warnings) through syslog-ng. I am using SLES 10 SP1 and syslog-ng version 1.6.8.

In the configuration file /etc/syslog-ng/syslog-ng.conf.in entered the following lines to format the log message:
Code:
template t_demo { template("$ISODATE $HOST $MSG\n"); template_escape(no); };
After this i run the commands "/sbin/SuSEconfig --module syslog-ng;rcsyslog restart

the first command succeeds where as the second command (syslog restart) fails saying
Code:
Starting syslog servicessyntax error at 165
Parse error reading configuration file, exiting. (line 165)
startproc:  exit status of parent of /sbin/syslog-ng: 1
                                                                      failed
. If i remove the template definition, then it syslog service is starting properly.


It would be great if somebody help me out of this.

Thanks in advance,

Sridhar
 
Old 08-30-2008, 03:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
templates aren't defined as objects like destinations, filters and sources. e.g....

Code:
 destination df_local1 {
         file("/mnt/log/$R_YEAR-$R_MONTH-$R_DAY/$SOURCEIP/local.log"
         template("$FULLDATE <> $PROGRAM <> $MSGONLY\n")
         template_escape(no));
 };
 
Old 09-01-2008, 01:23 AM   #3
ksri07091983
Member
 
Registered: Nov 2007
Location: Chennai,TamilNadu,India
Distribution: RedHat,SuSE
Posts: 65

Original Poster
Rep: Reputation: 15
Hi Chris,


Thanks a million. That worked !!. Great Help.

I read in the syslog documentation (syslog-ng-v2.0-guide-admin-en.pdf)like this :

Code:
template t_demo_filetemplate {
template("$ISODATE $HOST $MSG\n"); template_escape(no); };
destination d_file {
file("/var/log/messages" template(t_demo_filetemplate)); };
i hope this applies for syslog version 2.0. Since i was using a syslog version lesser than 2.0 this might not have worked, i believe.


Thanks once again Chris,

have a great day !!

Sridhar
 
Old 09-02-2008, 03:14 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
2.0 and 1.6 are pretty different, I'm not sure of the details but i know the config files are highly incompatible.
 
  


Reply



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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
Usage of "k size" option in "tar" ?? kcarun Solaris / OpenSolaris 4 08-20-2007 02:59 PM
"Shutdown" and "Restart" option missing after upgrade hansalfredche Mandriva 8 11-02-2006 07:23 AM
When "function pointer" meets "template"... I can't get rid of this compiling er cyu021 Linux - Software 3 12-17-2004 07:52 PM
anging "Protocol" option to "IMPS/2" in XF86Config-4 causes problems zstingx Linux - General 2 10-27-2003 09:47 AM

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

All times are GMT -5. The time now is 12:14 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
Open Source Consulting | Domain Registration