LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-16-2017, 07:19 PM   #1
glb
LQ Newbie
 
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
How to enable copying of selected logs files incrementally to a remote server in real time - as per change in log.


So as per question,

I am thinking rsync over ssh - yet how to tell rsync to do it?

Idea is to copy to a remote server every change in a selected log as it happen.
 
Old 07-17-2017, 12:03 AM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
I would create a cron job to monitor the file for changes and update your remote copy accordingly. I'm unaware of any event-based scheduler that will do it in real time
 
Old 07-17-2017, 01:29 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Centralised logging is a common requirement. rsyslog, logstash, ... pick your poison depending on need.
 
Old 07-17-2017, 01:45 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,725

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Sorry, I gotta ask: Why remote? Why not monitor the log file where it is?
Code:
tail -F /full/path/to/log/file
 
Old 07-17-2017, 02:13 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,295
Blog Entries: 3

Rep: Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719Reputation: 3719
Quote:
Originally Posted by glb View Post
Idea is to copy to a remote server every change in a selected log as it happen.
In that case, syg00 has suggested centralized logging and I would go with that. Which logging utility is your source system running? Which one do you have on the target system? Which distro, including version, are you on?

If you try rsync for that specific task, there will be a lot of overhead as the files on both machines are read and processed. rsync would be excellent after the log file has been closed and archived.
 
Old 07-17-2017, 08:52 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
a 100 solutions.

I like ELK
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Monitor Server Logs in Real-Time with "Log.io" Tool LXer Syndicated Linux News 0 02-13-2016 05:21 AM
Need to automatically create duplicate copy of log files in real time taximan Linux - Server 2 05-26-2015 10:43 AM
Local log file analysis for remote server logs halfpower Linux - Server 1 12-01-2014 12:29 PM
Enable Audit logs to send logs to syslog-ng (remote server) Iyyappan Linux - Server 5 01-07-2014 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration