首页 > 技术文章 > 自动化运维之日志系统Logstash实践Rsyslog(四)

chenshengqun 2017-12-09 16:37 原文

6.1Logstach收集rsyslog日志

1.修改rsyslog.conf配置文件

 
  1. [root@linux-node3 elasticsearch]#vim /etc/rsyslog.conf
  2. *.* @@192.168.90.203:514
  3. [root@linux-node3 elasticsearch]# systemctl restart rsyslog

2.编写收集rsyslog日志,写入至node4的Redis(Redis配置请自行谷歌,这里不在介绍)

 
  1. [root@linux-node3 conf.d]# cat rsyslog.conf
  2. input {
  3. syslog {
  4. type => "system_rsyslog"
  5. host => "192.168.90.203"
  6. port => "514"
  7. }
  8. }
  9. output {
  10. redis {
  11. host => "192.168.90.204"
  12. port=> "6379"
  13. db => "6"
  14. data_type => "list"
  15. key => "system_rsyslog"
  16. }
  17. }

推荐阅读