elasticsearch 日志存储输出未显示在kibana中,elasticsearch,logstash,kibana,elasticsearch,Logstash,Kibana" /> elasticsearch 日志存储输出未显示在kibana中,elasticsearch,logstash,kibana,elasticsearch,Logstash,Kibana" />

elasticsearch 日志存储输出未显示在kibana中

elasticsearch 日志存储输出未显示在kibana中,elasticsearch,logstash,kibana,elasticsearch,Logstash,Kibana,我刚开始学习弹性搜索,并尝试通过logstash将IIS日志转储到ES,看看它在Kibana中的效果。 已成功设置所有3个代理,并且它们运行时没有错误。但是,当我对存储的日志文件运行logstash时,这些日志不会显示在Kibana中。 (我使用的ES5.0没有“head”插件) 这是我在logstash命令中看到的输出 Sending Logstash logs to C:/elasticsearch-5.0.0/logstash-5.0.0-rc1/logs which is now

我刚开始学习弹性搜索,并尝试通过logstash将IIS日志转储到ES,看看它在Kibana中的效果。 已成功设置所有3个代理,并且它们运行时没有错误。但是,当我对存储的日志文件运行logstash时,这些日志不会显示在Kibana中。 (我使用的ES5.0没有“head”插件)

这是我在logstash命令中看到的输出

    Sending Logstash logs to C:/elasticsearch-5.0.0/logstash-5.0.0-rc1/logs which is now configured via log4j2.properties.
06:28:26.067 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Elasticsearch pool URLs updated {:changes=>{:removed=>[], :added=>["http://localhost:9200"]}}
06:28:26.081 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Using mapping template from {:path=>nil}
06:28:26.501 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - Attempting to install template {:manage_template=>{"template"=>"logstash-*", "version"=>50001, "settings"=>{"index.refresh_interval"=>"5s"}, "mappings"=>{"_default_"=>{"_all"=>{"enabled"=>true, "norms"=>false}, "dynamic_templates"=>[{"message_field"=>{"path_match"=>"message", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false}}}, {"string_fields"=>{"match"=>"*", "match_mapping_type"=>"string", "mapping"=>{"type"=>"text", "norms"=>false, "fields"=>{"keyword"=>{"type"=>"keyword"}}}}}], "properties"=>{"@timestamp"=>{"type"=>"date", "include_in_all"=>false}, "@version"=>{"type"=>"keyword", "include_in_all"=>false}, "geoip"=>{"dynamic"=>true, "properties"=>{"ip"=>{"type"=>"ip"}, "location"=>{"type"=>"geo_point"}, "latitude"=>{"type"=>"half_float"}, "longitude"=>{"type"=>"half_float"}}}}}}}}
06:28:26.573 [[main]-pipeline-manager] INFO  logstash.outputs.elasticsearch - New Elasticsearch output {:class=>"LogStash::Outputs::ElasticSearch", :hosts=>["localhost:9200"]}
06:28:26.717 [[main]-pipeline-manager] INFO  logstash.pipeline - Starting pipeline {"id"=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>5, "pipeline.max_inflight"=>500}
06:28:26.736 [[main]-pipeline-manager] INFO  logstash.pipeline - Pipeline main started
06:28:26.857 [Api Webserver] INFO  logstash.agent - Successfully started Logstash API endpoint {:port=>9600}
但是kibana没有显示任何索引。我是这里的新手,不知道内部发生了什么。你能帮我理解这里出了什么问题吗

日志存储配置文件:

input { 
    file {
        type => "iis-w3c"
        path => "C:/Users/ras/Desktop/logs/logs/LogFiles/test/aug1/*.log"
      }
}
filter {  
    grok {
        match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:serviceName} %{WORD:serverName} %{IP:serverIP} %{WORD:method} %{URIPATH:uriStem} %{NOTSPACE:uriQuery} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clientIP} %{NOTSPACE:protocolVersion} %{NOTSPACE:userAgent} %{NOTSPACE:cookie} %{NOTSPACE:referer} %{NOTSPACE:requestHost} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:win32response} %{NUMBER:bytesSent} %{NUMBER:bytesReceived} %{NUMBER:timetaken}"]
      }
     mutate {
    ## Convert some fields from strings to integers
    #
    convert => ["bytesSent", "integer"]
    convert => ["bytesReceived", "integer"]
    convert => ["timetaken", "integer"]

    ## Create a new field for the reverse DNS lookup below
    #
    add_field => { "clientHostname" => "%{clientIP}" }

    ## Finally remove the original log_timestamp field since the event will
    #   have the proper date on it
    #
    remove_field => [ "log_timestamp"]
  }
}
output {
  elasticsearch { 
        hosts => ["localhost:9200"]
        index => "%{type}-%{+YYYY.MM}"
  }
  stdout { codec => rubydebug }
}

您可以使用类似kopf的插件或端点
\u cat/index/
检查Elasticsearch中存在的索引名称,您可以通过
[ip of ES]:9200/\u cat/index
或curl:
curl[ip of ES]:9200/\u cat/index
的浏览器直接访问该端点


使用Kibana,您必须提供索引名的模式,默认情况下是
logstash-*
,如屏幕截图所示。此默认值在Kibana中使用,因为在logstash的elasticsearch输出插件中,默认索引模式是
logstash-%{+YYYY.MM.dd}
(),它将用于命名使用此插件创建的索引


但是在您的例子中,插件配置为
index=>“%{type}-%{+yyy.MM}”
。因此,创建的索引将采用
iis-w3c-%{+YYYY.MM}
格式。因此,您必须将
logstash-*
替换为
iis-w3c-*
字段中的
索引名称或模式

而不是head,您可以使用kopf,与head相比,我更喜欢它。但我不知道它是否适用于ES 5。当我使用_cat/index/时,我只得到黄色打开的文本。kibana HUMxXPMtS0-MBNQtyj5G6g 1 1 1 0 3.2kb 3.2kb。我没有看到任何名为iis*@Raghav的索引,所以问题在于Logstash。如果Logstash已经读取了文件(例如,仅使用stdout),则如果重新启动,Logstash将不会再次读取文件。看看这个答案