#####2。如何更改日志采样格式####
1.定义日志采样格式
$template WESTOS_FORMAT,"%FROMHOST%-IP% %timehererated% %FROMHOST-IP% %syslogtag% %msg%\n"

WESTOS_FORMAT: #格式名称
%FROMHOST%-IP% #日志来源主机IP
%timehererated% #日志生成时间
%syslogtag% #日志生成服务
%msg% #日志内容
\n #换行

2.设定日志采集格式应用
.;authpriv.none /var/log/westos;WESTOS

module(load=“bulitin:omfile” Template=“WESTOS_FORMAT”) #默认采用WESTOS_FORMAT格式

####3。timedatectl####
timedatectl set-time “2020-02-13 10:21:21” #设定系统时间
timedatectl list-timezones #显示系统的所有时区
timedatectl set-timezone “Asia/Shanghai” #设定系统时区
timedatectl set-local-rtc 0|1 #设定系统时间计算方式
#0表示使用utc时间计算方式
class_11_1.linux系统日志管理2

###4.时间同步服务###
配置文件:chronyd.service
配置文件:/etc/chrony.conf

在time_server中

vim /etc/chrony.conf
26 allow 172.254.0/24 #允许172.25.254.0网段主机同步时间
29 local stratum 10 #开启时间同步服务器功能并设定级别为10
在这里插入图片描述

systemctl restart chronyd.service
systemctl stop firewalld

在time_clint中
vim /etc/chrony.conf
pool 172.25.254.100 iburst

systemctl restart chronyd

相关文章: