Graphic tutorial on configuring log server in Linux

Graphic tutorial on configuring log server in Linux

Preface

This article mainly introduces the relevant content about Linux configuration log server, sharing it for your reference and learning. Let's take a look at the detailed introduction.

Log server configuration file: /etc/rsyslog.conf

Server side:

The server IP is as follows:

Edit the log server configuration file:

Here, choose either UDP or TCP

Copy the two commented sentences and then uncomment them.

Enter the directory to create a configuration file and configure the client to be monitored

Vim editor opens


The content is as follows:

The content format is as follows:

: attribute, comparison operator, "value" storage location

Attributes include the following
fromhost Which host name sent from
fromhost-ip Which ip sent it from
msg is determined from the content of the log information
hostname The comparison operators for judging the hostname in the log include the following
contains
isequal
startswith starts with

Restart the log service

You can see that a directory record file has been generated in the target directory, and the content is empty

Client side:

The client IP is: 192.168.0.100/24

Edit the configuration file:


Add the following line at the end to specify the log server address and port number


Save and exit, restart the log service

Start verification:

Use the server to try to connect to the client via ssh:

Connection failed due to password entry

Now let’s check the log file:

As above, the ssh connection record has been recorded in the log file

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support for 123WORDPRESS.COM.

You may also be interested in:
  • Analysis of a large number of http 400 error requests in the Linux server nginx access log
  • Unable to create session when error occurs, please check PHP or web server logs and configure PHP installation correctly (win+linux)
  • View Apache Server Error Log on Linux System

<<:  mysql 5.7.18 winx64 password change

>>:  Vue uses monaco to achieve code highlighting

Recommend

Introduction to the use of the indeterminate property of the checkbox

When we use the folder properties dialog box in Wi...

How to install and deploy MySQL 8.0 under CentOS8

MySQL 8 official version 8.0.11 has been released...

Summary of 16 XHTML1.0 and HTML Compatibility Guidelines

1. Avoid declaring the page as XML type . The pag...

WeChat applet implements jigsaw puzzle game

This article shares the specific code for impleme...

JavaScript lazy loading detailed explanation

Table of contents Lazy Loading CSS styles: HTML p...

A brief discussion on docker compose writing rules

This article does not introduce anything related ...

Implementation of Docker deployment of Tomcat and Web applications

1. Download docker online yum install -y epel-rel...

Pure CSS implementation of radio and checkbox effect example

radio-and-checkbox Pure CSS to achieve radio and ...

Let's talk in detail about the direction of slow SQL optimization in MySQL

Table of contents Preface SQL statement optimizat...

JavaScript imitates Jingdong carousel effect

This article shares the specific code for JavaScr...

Two ways to create SSH server aliases in Linux

Preface If you frequently access many different r...

MySQL foreign key setting method example

1. Foreign key setting method 1. In MySQL, in ord...

3 common errors in reading MySQL Binlog logs

1. mysqlbinlog: [ERROR] unknown variable 'def...

Solutions to Mysql index performance optimization problems

The optimization created by MySQL is to add index...