[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 482
  • Last Modified:

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

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
KerryChin
Asked:
KerryChin
1 Solution
 
terrydavisCommented:
Make sure you have 'create_dirs (yes);' in your options block.
0
 
KerryChinAuthor Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now