+ Logging, Syslog and Log Anaylsys Forums » Forums » Syslog & syslogd » syslog-ng
|-+ 

How to capture a log file in syslog-ng?

Username:
Password:
News:

Pages: [1]
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read August 21, 2008, 07:19:20 am #0
smith

How to capture a log file in syslog-ng?

I have an application that creates it's own log file on a linux server.  I would like to have the logs it produces sent to my central log server.  How can I accomplish that?  I am running syslog-ng on the central log server.
Offline  
Read August 21, 2008, 08:52:28 am #1
mutex

Re: How to capture a log file in syslog-ng?

There are two ways you can do that:

If you have syslog-ng running on the client systems, you can add an entry like this:
source s_tail { file("myapp.log" follow_freq(1) flags(no-parse)); };

Then, send that to your central server.

Otherwise, you could try this:

tail -f myapp.log | sed -e 's/^/<133>/' | nc syslog-ng-server 514

Offline  
Pages: [1]
Jump to:  


Information Security News | Jerry Bell's blog | Enterprise IT | Tropical Fish Information | Tropical Fish Forums