• Logstash IIS日志采集


    Logstash IIS 日志采集,跟Linux上运行差不多,都需要java运行环境,装个jdk就好了,对于IIS日志暂时未处理X-forward-for,纠结怎么弄当中,貌似要装个插件,慢慢研究。

    input {
      file {
        type => "IIS Log"
        path => ["C:/inetpub/logs/LogFiles/W3SVC2/u_ex*.log"]
      }
    }
    filter {
      grok {
    
          # check that fields match your IIS log settings
          match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} 
    
    %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NUMBER:response} 
    
    %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:time_taken}"]
      }
    
      #Set the Event Timesteamp from the log
        date {
        match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss" ]
          timezone => "Etc/UTC"
      }    
        
      
      useragent {
        source=> "useragent"
        prefix=> "browser"
      }
        
      mutate {
        remove_field => [ "log_timestamp"]
      }
    
    }
    output {
      stdout {codec => rubydebug }
      redis {
        host => '你的ip地址'
        data_type => 'list'
        key => 'logstash:redis'
      }
    }

     

    补充:

    已经解决 windows iis日志显示源地址插件,可以添加下面这个插件

    https://devcentral.f5.com/articles/x-forwarded-for-log-filter-for-windows-servers

  • 相关阅读:
    2020.10.08 模拟赛 题解
    可爱路径 题解
    飞行路线 题解2
    架设电话线 题解
    浅谈 LCA
    浅谈 Tarjan 算法之强连通分量(危
    初赛题目整理1
    【求助,待续!】holes
    【题解】HDU4467
    【题解】zhx154嬲
  • 原文地址:https://www.cnblogs.com/caoguo/p/5038160.html
Copyright © 2020-2023  润新知