Solved

Feeding updtes in a text file to remote syslog server continuously

Posted on 2009-05-06
8
461 Views
Last Modified: 2012-05-06
Hi,

I am trying to find a solution to feed the text log files of some application servers to remote syslog server.

Remote syslog server is running syslog-ng and setup to deliver the incoming log records to different files per host. So the setup is ready.

What I am looking for is a mechanism to feed the content of these text files to remote syslog server via syslog protocol (logger for example). As I don't want to interfere with the application itself, I don't want to modify it to send directly to syslog. A utility would be perfect to capture everything appended to the text file and send it via syslog protocol. This will also make sure that any problem on syslog server or the utility itself will not affect the application's availability.

Any information on this will be appreciated.

Thanks and regards..

-Suleyman Kutlu (SNK)
0
Comment
Question by:SNK-67
  • 4
  • 3
8 Comments
 
LVL 62

Expert Comment

by:gheist
ID: 24315174
You can create fifo and attach logger to other end of fifo (or nc for direct feeding to syslog-ng)

mkfifo logfile
logger < logfile & 

0
 
LVL 1

Author Comment

by:SNK-67
ID: 24316034
I am a little confused. What I understand from the command

mkfifo logfile

is to create a FIFO file. But the log files which I want to feed to syslog server are created and managed (rotated) by the application server itself. So I am afraid that if I use mkfifo solution, I will interfere with the application log management.

Did I understand wrong?
0
 
LVL 62

Expert Comment

by:gheist
ID: 24318828
If you are able to make application to not rotate logs and feed data into fifo placed where log should be you are winner.
Is this some sort of standard application like log4j or apache?
0
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.

 
LVL 1

Author Comment

by:SNK-67
ID: 24324594
Most of them are log4j, some Apache or SunONE webserver log, some custom application logs.
0
 
LVL 62

Expert Comment

by:gheist
ID: 24324665
There is syslog support in log4j
Apache is too heavy for syslog (imagine sending extra log packet for every access log entry)
0
 
LVL 1

Author Comment

by:SNK-67
ID: 24324802
I know the support in log4j but the main idea on not using this feature is not to cause any problem on the application such as being unable to send logs to syslog server from log4j for any reason (network problems, etc).. Currently if log4j cannot write logs to disk for some reason (such as disk is full) application encounters problems. I don't want to cause such problems on application.

Hence my idea was without changing anything on application settings, I want to grab the logs from the file and send it to syslog server. If for some reason I cannot send to syslog server, it will be a problem of infrastructure group, not the application itself !!

I hope the idea is clear.

0
 
LVL 62

Expert Comment

by:gheist
ID: 24329217
Syslog is stable, accepts log messages when disk full, config file invalid etc.
Apache can log to syslog also.
I assume sun one uses log4j also.
Custom apps can be changed to use log4j.
0
 
LVL 3

Accepted Solution

by:
tkuther earned 125 total points
ID: 24462545
We use rsyslog for such things.

It can nicely monitor any files
http://www.rsyslog.com/doc-imfile.html
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

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