2

因为我删除了所有索引,所以我面临这个问题。为此,我执行了以下命令

curl -XDELETE 'http://localhost:9200/*' 

文件节拍.yml

filebeat:
  prospectors:
    -
     paths:
      - /var/log/syslog
    - input_type : log
      document_type: syslog
  registry_file: /var/lib/filebeat/registry
output:
  logstash:
    hosts: ["127.0.0.1:5044"]
    bulk_max_size: 1024

shipper:
logging:
  files:
    rotateeverybytes: 10485760 # = 10MB

和 logstash 配置文件输入配置

   input {
      beats {
        port => 5044
      }
    }

并输出配置

  output {
      elasticsearch {
        hosts => ["localhost:9200"]
        sniffing => true
        manage_template => false
        index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
        document_type => "%{[@metadata][type]}"
      }
    }

问题是日志不是通过 logstash 来的,这些是直接来的,因为我看不到在 kibana 中添加的新字段,并且在 apche-access 日志的情况下,只有日志作为类型的值。

4

2 回答 2

3

您的 Filebeat 配置中可能只是有语法错误,请尝试更改

 - input_type : log

input_type : log

声明-第二个探矿者肯定会弄乱你的配置。如果您所有的 logstash 处理都是按类型完成的,那么您输入不正确的日志将通过 logstash 进入 elasticsearch 而不进行解析。

于 2016-07-12T15:59:36.583 回答
-1

如您的配置文件所示,您已经注释掉了 elasticsearch 输出配置。因此,您收到的输出不是因为 elasticsearch,而是因为 logstash。您已将其添加为注释,但应该这样做:

elasticsearch:
# Array of hosts to connect to.
# Scheme and port can be left out and will be set to the default (http and 9200)
# In case you specify and additional path, the scheme is required: http://localhost:9200/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:9200
   hosts: ["localhost:9200"]
于 2016-07-12T14:27:33.587 回答