IIS的Logstash配置文件

时间:2014-08-22 14:13:19

标签: windows iis logstash

我最近在Windows服务器上安装了ELK堆栈(在此之后:https://community.ulyaoth.net/threads/how-to-install-logstash-on-a-windows-server-with-kibana-in-iis.17/

我可以将IIS日志从服务器导入Logstash并进入Elasticsearch,但我无法从其他服务器获取相同的日志。

这是我的第二台服务器的logstash配置文件;

    input { 
    file {
        type    => "IISLog"
        path    => "C:/inetpub/logs/LogFiles/W3SVC*/*.log"
        }
    }

filter {
    mutate {
        add_field   => [ "hostip", "%{host}" ]
        }
    dns {
        reverse => [ "host" ]
        action  => replace
        }
    }

output {
    elasticsearch {
        host    => "ELK01v"
        port    => "9301"
        }
    }

但是Kibana没有任何显示

在Logstash的stderr.log中,我可以看到以下内容;

Exception in thread ">output" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]
    at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(org/elasticsearch/action/support/master/TransportMasterNodeOperationAction.java:180)
    at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(org/elasticsearch/cluster/service/InternalClusterService.java:492)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(java/util/concurrent/ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(java/util/concurrent/ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(java/lang/Thread.java:745)

这来自stdout.log;

{:timestamp=>"2014-08-22T15:04:55.775000+0100", :message=>"Using milestone 2 input plugin 'file'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones", :level=>:warn}
{:timestamp=>"2014-08-22T15:04:55.853000+0100", :message=>"Using milestone 2 filter plugin 'dns'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones", :level=>:warn}
log4j, [2014-08-22T15:05:34.215]  WARN: org.elasticsearch.discovery: [logstash-WEB01v-3460-4038] waited for 30s and no initial state was set by the discovery
log4j, [2014-08-22T15:09:06.334]  WARN: org.elasticsearch.transport: [logstash-WEB01v-3460-4038] Transport response handler not found of id [240]

我已经确认我可以通过端口9301 telnet到ELK01v,但我想不出还有什么可能导致这些错误。有没有ELK知识的人可以提供帮助呢?

由于

1 个答案:

答案 0 :(得分:0)

这表明它正在尝试加入您的群集但由于某种原因而无法做到(例如防火墙 - 加入群集时双向通信)。最简单的解决方案是将protocol => http添加到您的elasticsearch输出中。这将起作用,因为您已经验证防火墙是朝这个方向开放的。