内容目录

网络设备配置

  • 华为
info-center loghost source Vlanifxxx
info-center loghost x.x.x.x facility local6 local-time
  • 华三
 info-center loghost source Vlan-interfacexxx
 info-center loghost vpn-instance wangguan x.x.x.x facility local5

rsyslog配置

vim /etc/rsyslog.conf
$template h3c,"/var/log/network/h3c/%$YEAR%_%$MONTH%_%$DAY%-%FROMHOST-IP%.log"
local5.* ?h3c
$template huawei,"/var/log/network/huawei/%$YEAR%_%$MONTH%_%$DAY%-%FROMHOST-IP%.log"
local6.* ?huawei

crontab -l
#每天凌晨3点执行删除f5000session、h3c、huawei网络设备日志;by:yujing 2024/8/7
00 03 * * * bash -x /opt/delete_session_log.sh &> /tmp/delete.log

cat /opt/delete_session_log.sh
# 获取当天日期,并格式化为find需要的格式
TODAY=$(date +'%Y-%m-%d')

find /firewall/f5000session/ -type f -name "*.log"  ! -newermt "$TODAY"   | xargs rm -f
find /var/log/network/huawei/ -type f -name "*.log"  -mtime +1   | xargs rm -f
find /var/log/network/h3c/ -type f -name "*.log"  -mtime +1   | xargs rm -f

重启rsyslog服务
systemctl restart rsyslog

elastic配置(在kibana上配置)

  1. 配置索引模板networks-template

file

  1. 索引管理
    配置好后在索引管理上会看到名称为networks-huawei-2024.09.06networks-h3c-2024.09.06的索引

file

然后添加好networks-h*的索引模式

  1. discover菜单

file

最后修改日期: 2024年9月6日

留言

撰写回覆或留言

发布留言必须填写的电子邮件地址不会公开。