1、環(huán)境介紹
交換機(jī):華為、思科、H3C
Elasticsearch版本:7.13.3
kibana版本:v 7.13.3
logstash版本:7.17.8
2、ES集群配置
參考:
https://blog.csdn.net/zyj81092211/article/details/118935274
3、kibana配置
參考
https://blog.csdn.net/zyj81092211/article/details/118967979
4、logstash配置
安裝key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
添加軟件源,編輯logstash.repo文件添加如下
[logstash-7.x]
name=Elastic repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
安裝logstash
yum install logstash
編輯systemd啟動(dòng)文件,更改為root用戶(端口號(hào)小于1000的程序,普通用戶會(huì)因?yàn)闄?quán)限問題不能啟動(dòng),這里改成root用戶啟動(dòng))
vi /etc/systemd/system/logstash.service
5、編輯logstash交換機(jī)配置文件
配置文件放到目錄/etc/logstash/conf.d/
vi /etc/logstash/conf.d/switch.conf
添加如下
input{syslog {type =>"HUAWEI"
port =>514
}
syslog {type =>"CISCO"
port =>5002
}
syslog {type =>"H3C"
port =>5003
}
}
output{stdout {#將日志輸出到當(dāng)前終端上顯示
codec =>rubydebug
}
#同時(shí)也發(fā)送到elasticsearch
elasticsearch {index =>"switch-syslog-%{+YYYY.MM}"
user =>elastic
password =>"Smtgbk_123"
hosts =>["esdn01.wtown.com:9200"]
}
}
6、啟動(dòng)logstash
systemctl start logstash
systemctl enable logstash
7、華為交換機(jī)配置外置日志中心
info-center loghost source Vlanif1
info-center loghost 10.99.50.123
info-center enable
8、H3C交換機(jī)配置外置日志中心
info-center loghost source Vlan-interface1
info-center loghost 10.99.50.123 port 5003
9、思科交換機(jī)配置外置日志中心
enable
configure terminal
logging host 10.99.50.123 transport tcp port 5002
logging on
logging trap 7
logging facility local5
logging source-interface Loopback 0 //這里改成交換機(jī)地址所在端口
service timestamps log datetime localtime
10、Edge ES瀏覽器插件
11、配置kibana
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購,新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧