Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure the log server by Linux

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to configure the log server in Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Preface

Log server configuration file: / etc/rsyslog.conf

Server side:

The server IP is as follows:

Edit the configuration file for the log server:

Choose either UDP or TCP here.

Copy the two sentences of the comment, and then uncomment.

Go to the directory to create a configuration file and configure the clients to be monitored

Vim Editor Open

The contents are as follows:

The content format is as follows:

Attribute, comparison operator, value save location

Properties include the following

Fromhost, which hostname came from?

Fromhost-ip, which ip sent it?

Msg judges from the contents of the log information

Hostname determines from the hostname in the log

The comparison operator includes the following

Contains contains

Isequal equals

Startswith to... The beginning

Restart the logging service

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

Client side:

The client IP is: 192.168.0.100 Universe 24

Edit the configuration file:

At the end, add the following line to specify the log server address and port number

Save to exit and restart the logging service

Start validation:

Try to connect to the client through ssh on the server side:

The connection failed due to entering a password

Now I'm going to check the log file:

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

This is the end of the article on "how to configure the log server in Linux". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report