Solved

Syslog-Ng will not start when I use macros in the destination drivers

Posted on 2007-11-21
2
463 Views
Last Modified: 2010-05-18
I wanted to collect syslog messages on one machine using syslog-ng.  The server box is a SuSE linux 10.1 machine and syslog-ng 1.6.8-20.18.  Documentation states that I can use a macro ($HOST) when naming the files that I same the messages to.  When I put the macro into the destination line, syslog-ng will not start.  Without the macro it starts correctly.  The first code snippet included does not work, while the second code snippet does.  I do not have both snippets in the syslog-ng.conf file at the same time.  Any insight into this would be helpful.

On a side note, I tried to have the files save to a different place than /var/log and the files would not even be created, but when directed to save in /var/log there was no problem.  Insight into this would also be appreciated.

Thanks in advance.
destination allmessages { file("/var/log/syslog/$HOST/allmessages"); };
log { source(src); destination(allmessages); };
 
 
destination allmessages { file("/var/log/syslog/allmessages"); };
log { source(src); destination(allmessages); };

Open in new window

0
Comment
Question by:KerryChin
2 Comments
 
LVL 2

Accepted Solution

by:
terrydavis earned 250 total points
ID: 20328769
Make sure you have 'create_dirs (yes);' in your options block.
0
 

Author Closing Comment

by:KerryChin
ID: 31410388
That's all it took!  Thank you very much!  I don't know if this works for the going to a different directory other than /var/log, but I mounted the drive under /var/log/syslog and that part is solved for me.  Thanks again!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
Fine Tune your automatic Updates for Ubuntu / Debian
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question