1

我已经按照 elastic.co 的描述配置了 filebeat

问题是当我添加一个新的日志文件时,数据没有上传到logstash。可能是什么问题?我已经尝试了不同的配置方式,但它根本不起作用。

################### Filebeat Configuration Example #########################

############################# Filebeat ######################################
filebeat:
  # List of prospectors to fetch data.
  prospectors:
    -
      paths:
        - /Users/apps/*.log

      input_type: log


###############################################################################
############################# Libbeat Config ##################################
# Base config file used by all other beats for using libbeat features

############################# Output ##########################################

output:
  elasticsearch:
    hosts: ["localhost:9200"]
    worker: 1

    index: "filebeat"

    template:
     path: "filebeat.template.json"

  ### Logstash as output
  logstash:
    # The Logstash hosts
    hosts: ["localhost:5044"]

    index: filebeat



############################# Shipper #########################################

############################# Logging #########################################

# There are three options for the log ouput: syslog, file, stderr.
# Under Windos systems, the log files are per default sent to the file output,
# under all other system per default to syslog.
logging:

  files:

    rotateeverybytes: 10485760 # = 10MB

在 logstash.conf 中配置:

input {
  beats {
    port => 5044
  }
}

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

2 回答 2

2

你们都在发送 Elasticsearch 和 logstash。如果要将弹性搜索部分发送到logstash,则需要删除它。取自https://www.elastic.co/guide/en/beats/filebeat/current/config-filebeat-logstash.html

如果要使用 Logstash 对 Filebeat 收集的数据进行额外处理,需要配置 Filebeat 使用 Logstash。

为此,您编辑 Filebeat 配置文件以通过将其注释掉来禁用 Elasticsearch 输出,并通过取消注释 logstash 部分来启用 Logstash 输出

于 2016-05-13T05:05:08.467 回答
0

您可以如下检查 filebeat.yml 中的工作人员数量吗?

  ### Logstash as output
  logstash:
    # The Logstash hosts
    hosts: ["localhost:5044"]
    # Number of workers per Logstash host.
    worker: 1

您应该在 logstash 部分中添加工人计数

于 2016-07-01T04:14:17.137 回答