Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Security
Reload this Page Logging - Text File to Syslog
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Security Discussion about keeping your machines secure, and the crackers out.

Reply
 
Thread Tools Display Modes
Old 01-29-2008   #1 (permalink)
Linux Newbie
 
humbletech99's Avatar
 
Join Date: Nov 2005
Posts: 209
Logging - Text File to Syslog

I have some databases which log to a flat text file and I don't think that this version can log to syslog, so I'd like to stream the log file into syslog myself. I figure that keeping something like this running should work:
Code:
tail -f /path/to/logfile | logger
or
Code:
logger -f /path/to/logfile
My question is whether or not there is a better way of doing this?

I think that if this process is restarted, and the logfile is always quite large, that it will read at least some of it again and duplicate that information into syslog which I'd like to avoid.

Is there a better way, some program perhaps that will remember it's position in the logfile and if crashed/restarted will pick up again from that exact point without missing anything or reinserting the same log information again, possibly also handling log truncation or rotation? Does logger -f have an intelligence on this?
__________________
The Human Equation:

value(geeks) > value(mundanes)
humbletech99 is offline   Reply With Quote
Old 01-29-2008   #2 (permalink)
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,699
What is the application doing the logging exactly? Usually daemons write to a syslog facility, which you can configure appropriately.
__________________
FreeBSD Handbook & FAQ // CentOS wiki
anomie is offline   Reply With Quote
Old 01-29-2008   #3 (permalink)
Linux Newbie
 
humbletech99's Avatar
 
Join Date: Nov 2005
Posts: 209
this is Oracle 9i, I don't believe it has a syslog feature in this version from what I'm told.

I also want to know how to do this in a nice way because it's a cool thing to do in general should I need it in some other situation for some other program.


Does anyone know of a program like tail -f but with a memory for where it was in the file and handle log switching/truncation?
__________________
The Human Equation:

value(geeks) > value(mundanes)
humbletech99 is offline   Reply With Quote
Old 02-10-2008   #4 (permalink)
Just Joined!
 
Join Date: Jun 2007
Posts: 6
I will implement a text file input for rsyslog (syslogd supporting MySQL and TCP :: rsyslog ) this month (already begun to do so). If you are still interested, I would love to discuss feature set and of course I am also looking for testers.

Rainer
rgerhards is offline   Reply With Quote
Old 02-10-2008   #5 (permalink)
Linux Newbie
 
humbletech99's Avatar
 
Join Date: Nov 2005
Posts: 209
syslog-ng already has this so I'm not sure it's worth re-inventing the wheel.

The only reason I'm not using syslog-ng in this instance is that is a package-cripplied rpm rhel system that I cannot easily upgrade and is in heavy production so I'd rather not mess with it.

So in this instance, I am really stuck with a text file that I need a way of intelligently tailing...
__________________
The Human Equation:

value(geeks) > value(mundanes)
humbletech99 is offline   Reply With Quote
Old 02-11-2008   #6 (permalink)
Just Joined!
 
Join Date: Jun 2007
Posts: 6
Quote:
Originally Posted by humbletech99 View Post
syslog-ng already has this so I'm not sure it's worth re-inventing the wheel.
Yeah, I know it has this feature, but rsyslog shall provide it, too, so that it is a complete package. Its especially important as rsyslog now has a lot of features syslog-ng does not offer, at least not in the open source edition.

Quote:
Originally Posted by humbletech99 View Post
The only reason I'm not using syslog-ng in this instance is that is a package-cripplied rpm rhel system that I cannot easily upgrade and is in heavy production so I'd rather not mess with it.
I see... that's a restraint...

Quote:
Originally Posted by humbletech99 View Post
So in this instance, I am really stuck with a text file that I need a way of intelligently tailing...
Well, you could still use rsyslog for that. The v3 branch has very modular inputs and outputs. So once the file reader is ready, you could create an instance of rsyslog that does only run the file reader (and output to syslog) and run that alongside syslog-ng. Sounds a bit usual, but could be a good option for that use case...

HTH
Rainer
rgerhards is offline   Reply With Quote
Old 02-20-2008   #7 (permalink)
Just Joined!
 
Join Date: Jun 2007
Posts: 6
Rsyslog now supports text file to syslog conversion via the imfile plugin. Documentation is available on the site:

Text File Input Monitor :: syslogd supporting MySQL and TCP :: rsyslog

I would appreciate any deployment reports, including feature enhancement requests.

Rainer
rgerhards is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Similar Threads
Thread Thread Starter Forum Replies Last Post
apt 4 suse skiman SuSE Linux Help 4 11-24-2005 07:37 PM
Icons Not Showing. rub3x Slackware Linux Help 6 07-18-2005 06:33 AM
Enemy territory Game runs but appears to crash mattlaver Gaming / Games / Multimedia / Entertainment 7 03-14-2005 04:28 PM
Test Page always comes up instead of indended index.html spegger Servers 11 06-09-2004 10:46 AM

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 03:12 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0