zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    一款非常推荐的用户界面插件----EasyUI
    使用chart和echarts制作图表
    JS模拟实现封装的三种方法
    JavaScript面向对象(OOP)
    移动HTML5前端框架—MUI
    一款优秀的前端JS框架—AngularJS
    less和scss
    JS中的正则表达式
    JS中的数组
    js匿名函数
  • 原文地址:https://www.cnblogs.com/caoguo/p/5038160.html
Copyright © 2011-2022 走看看