首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IIS上的logstash和x-forwarded-for

IIS上的logstash和x-forwarded-for
EN

Stack Overflow用户
提问于 2016-07-13 21:07:28
回答 0查看 1.2K关注 0票数 0

我刚刚在Windows上构建了一个ELK服务器,所以我对这个过程还不熟悉。我已经通读了文档,但是在解析出我的IIS高级日志时遇到了麻烦,特别是当我们在负载均衡器后面时,对于数据的x转发。

我的高级日志设置为输出如下数据:

代码语言:javascript
复制
$date,  $time,  $s-ip,  $cs-uri-stem, $cs-uri-query, $s-port, $cs-username, $c-ip,  $X-Forwarded-For, $csUser-Agent, $cs-Referer, $sc-status, $sc-substatus, $sc-win32-status, $time-taken

我这样设置我的logstash.conf:

代码语言:javascript
复制
input {
  tcp {
      host => "localhost"
          type => "iis"
          port => 5044 

  }
}
filter {
    if [type] == "iis" {
        grok {
            match => {"message" => "%{TIMESTAMP_ISO8601:log_timestamp} %{IPORHOST:site} %{URIPATH:page} %{NOTSPACE:query_string} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:client_host} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{GREEDYDATA:response} %{NUMBER:httpStatusCode:int} %{NUMBER:scSubstatus:int} %{NUMBER:scwin32status:int} %{NUMBER:timeTakenMS:int}"}
        }
    }
}
output {
  elasticsearch {
        hosts => ["localhost:9200"]
        index => "iis"
        document_type => "main"
  }
}

我不认为这是正确的,因为我没有得到数据。我已经搜索了文档,但仍然有问题,不确定是否还有其他步骤需要我采取,如映射字段。

我目前正在使用来自一台服务器的filebeat将数据推送到我的ELK服务器。我不确定这是否也是最好的方法(也许是nxlog?)。我们不想在客户机上安装logstash。

有人能帮我一下吗?非常感谢!

谢谢,乔治

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38352655

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档