zoukankan      html  css  js  c++  java
  • filebeat收集系统登陆日志

    一、filebeat配置

    - type: log
    enabled: true
    paths:
    - /var/log/secure
    include_lines: [".*Failed.*",".*Accepted.*"]
    tags: ["secure"]

    二、logstash过滤配置

    ################      input   ##################
    input {
      beats {
        port => 5044
        codec => "json"
       }
     }
    
    ############   登陆日志过滤      ##################
    filter {
        if "secure" in [tags] {
        grok {
            match => {
                "message" => ".* sshd[d+]: (?<status>S+) .* (?<ClientIP>(?:d{1,3}.d{1,3}.d{1,3}.d{1,3})?) .*"
            }
            overwrite => ["message"]
        }
    }
    }

    output {

    if "comm" in [tags] {
         elasticsearch {
         hosts => "http://10.0.0.78:9200"
         index => "comm-%{+YYYY.MM}"
          user => "elastic"
         password => "123456"
                 }

                 }

    }

     

    三、kibanna查看

     

  • 相关阅读:
    筱玛的迷阵探险(折半搜索+01字典树)
    递推
    thin mission 2021 10 8
    4级 -- 阅读
    c++——小知识
    stl
    string
    ting mission 2021.9.20
    ting mission 2021.9.27
    欧拉函数
  • 原文地址:https://www.cnblogs.com/wangyong-blog/p/13679385.html
Copyright © 2011-2022 走看看