Solved

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

Posted on 2007-11-21
2
467 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expect & sshpass package for Solaris 10 x86 15 996
Linux SCP Chroot 2 67
IPA - change main server? 3 175
Are there any OTS solutions for creating locked down VM's 13 114
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
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 …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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