SlideShare a Scribd company logo
1 of 4
Download to read offline
LinuxTechLAB.com
Setup syslog server on Ubuntu
or CentOS for Centralized Logs
management
Checking logs is an important activity to see what’s happening on your Linux servers,
especially when you are trying to locate an issue. It easy when you are just managing
2, 3 servers but what to do when you are handling 50 or 100 servers?
That’s when Centralized log management comes into the picture. We can sync all the
Linux server logs (auth logs, cron logs, syslogs, etc) to a single Linux server so that
we have access to logs of all the servers, whether 1 or 100, on a single server &
when we are required to check logs, we will just login to a single server & will have
access to logs from all servers.
This is also useful when you don’t plan to give access to servers to all the individuals
but we can just give access to a centralized logs server & they can see logs from that
single machine only.
In this tutorial, we will learn to setup the Syslog server In CentOS machines & ubuntu
machines for centralized log management. This setup can be used for even hundreds
of servers but for the purpose of this tutorial, we will be using only two servers, i.e.,
1- Centralized log server or main server
2- A client-server
Recommended Read: Important Linux Log Files to monitor to identify
issues
Also Read:  Analyzing Webserver logs with Logstalgia
Let’s start with the setup of the Syslog server on the main server.
Setup Syslog server on the Ubuntu/CentOS
server (Centralized logs server)
Firstly, we need to install the rsyslog service on our system. This can be installed
using the following command on our system,
# yum install rsyslog -y
For Ubuntu machines, use the following command,
$ sudo apt install rsyslog -y
Once the package has been installed, we can start configuring the rsyslog service
using the configuration file,
# vim /etc/rsyslog.conf
Look for the following lines and uncomment them, to look like,
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
Similarly, look for these lines as well to uncomment them,
# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
Now save the file & exit. Next, we need to restart the rsyslog service to implement
the changes,
# systemctl restart rsyslog
We have actually enabled port 514 on both TCP & UDP, this port will be used to
receive the logs from all the servers. Next, we will move to our client-server.
Setup Syslog server on Client machines
(Ubuntu/CentOS)
The configuration that we are about to make can be made on all the clients that we
have. We will start by installing rsyslog on client machines,
# yum install rsyslog -y
For Ubuntu machines, use the following command,
$ sudo apt install rsyslog -y
Now open the rsyslog configuration file to make the changes,
# vim /etc/rsyslog.conf
Now at the end of the file, add the following lines,
cron.none;*.info;mail.none;authpriv.none @10.10.10.10:514
Now save the file and exit. Here we have entered the files that are to be sent to
centralized log servers & then we have mentioned the centralized log server IP
address with the port number.
To implement the changes made on client machines, we need to restart the rsyslog
service,
# systemctl restart rsyslog
This was it, now all the mentioned log files will be sent to a centralized log server and
a local copy will also be maintained.
Checking the logs of servers
Login to your centralized log server i.e. main server & go to the log folder,
# cd /var/log
Here, we can see all the logs in the file named ‘messages’
# tail -f /var/log/messages
That’s it, this completes our tutorial on how to setup a Syslog server for Centralized
Logs management on Ubuntu & CentOS servers. If you are facing any issues while
setting this up or have any other questions regarding this tutorial, you can contact us
using the comment box below.
We are giving you exclusive deals to try Linux Servers for free with
100$ credit, check these links to claim your 100$,
DigitalOcean - 100$ free credit & Linode - 100$ free credit
Check some Exclusive Deals, HERE.
Also, check out DevOps Book You should read section.

More Related Content

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Setup syslog server on ubuntu or cent os for centralized logs management

  • 1. LinuxTechLAB.com Setup syslog server on Ubuntu or CentOS for Centralized Logs management
  • 2. Checking logs is an important activity to see what’s happening on your Linux servers, especially when you are trying to locate an issue. It easy when you are just managing 2, 3 servers but what to do when you are handling 50 or 100 servers? That’s when Centralized log management comes into the picture. We can sync all the Linux server logs (auth logs, cron logs, syslogs, etc) to a single Linux server so that we have access to logs of all the servers, whether 1 or 100, on a single server & when we are required to check logs, we will just login to a single server & will have access to logs from all servers. This is also useful when you don’t plan to give access to servers to all the individuals but we can just give access to a centralized logs server & they can see logs from that single machine only. In this tutorial, we will learn to setup the Syslog server In CentOS machines & ubuntu machines for centralized log management. This setup can be used for even hundreds of servers but for the purpose of this tutorial, we will be using only two servers, i.e., 1- Centralized log server or main server 2- A client-server Recommended Read: Important Linux Log Files to monitor to identify issues Also Read:  Analyzing Webserver logs with Logstalgia Let’s start with the setup of the Syslog server on the main server. Setup Syslog server on the Ubuntu/CentOS server (Centralized logs server) Firstly, we need to install the rsyslog service on our system. This can be installed using the following command on our system, # yum install rsyslog -y For Ubuntu machines, use the following command,
  • 3. $ sudo apt install rsyslog -y Once the package has been installed, we can start configuring the rsyslog service using the configuration file, # vim /etc/rsyslog.conf Look for the following lines and uncomment them, to look like, # Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 Similarly, look for these lines as well to uncomment them, # Provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514 Now save the file & exit. Next, we need to restart the rsyslog service to implement the changes, # systemctl restart rsyslog We have actually enabled port 514 on both TCP & UDP, this port will be used to receive the logs from all the servers. Next, we will move to our client-server. Setup Syslog server on Client machines (Ubuntu/CentOS) The configuration that we are about to make can be made on all the clients that we have. We will start by installing rsyslog on client machines, # yum install rsyslog -y For Ubuntu machines, use the following command, $ sudo apt install rsyslog -y Now open the rsyslog configuration file to make the changes, # vim /etc/rsyslog.conf Now at the end of the file, add the following lines,
  • 4. cron.none;*.info;mail.none;authpriv.none @10.10.10.10:514 Now save the file and exit. Here we have entered the files that are to be sent to centralized log servers & then we have mentioned the centralized log server IP address with the port number. To implement the changes made on client machines, we need to restart the rsyslog service, # systemctl restart rsyslog This was it, now all the mentioned log files will be sent to a centralized log server and a local copy will also be maintained. Checking the logs of servers Login to your centralized log server i.e. main server & go to the log folder, # cd /var/log Here, we can see all the logs in the file named ‘messages’ # tail -f /var/log/messages That’s it, this completes our tutorial on how to setup a Syslog server for Centralized Logs management on Ubuntu & CentOS servers. If you are facing any issues while setting this up or have any other questions regarding this tutorial, you can contact us using the comment box below. We are giving you exclusive deals to try Linux Servers for free with 100$ credit, check these links to claim your 100$, DigitalOcean - 100$ free credit & Linode - 100$ free credit Check some Exclusive Deals, HERE. Also, check out DevOps Book You should read section.