首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >filebeat不会转发到logstash

filebeat不会转发到logstash
EN

Stack Overflow用户
提问于 2016-05-12 21:51:58
回答 2查看 2K关注 0票数 1

我已经按照elastic.co中的描述配置了文件节拍

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

代码语言:javascript
复制
################### 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中的配置:

代码语言:javascript
复制
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}"
  }
}
EN

回答 2

Stack Overflow用户

发布于 2016-05-13 13:05:08

你们都在发送Elasticsearch和logstash。如果您想将elasticsearch部分发送到logstash,则需要将其移除。摘自https://www.elastic.co/guide/en/beats/filebeat/current/config-filebeat-logstash.html

如果要使用Logstash对Filebeat收集的数据执行其他处理,则需要将Filebeat配置为使用Logstash。

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

票数 2
EN

Stack Overflow用户

发布于 2016-07-01 12:14:17

你能检查一下filebeat.yml中的工人数量吗?

代码语言:javascript
复制
  ### Logstash as output
  logstash:
    # The Logstash hosts
    hosts: ["localhost:5044"]
    # Number of workers per Logstash host.
    worker: 1

您应该在logstash部分中添加worker count

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

https://stackoverflow.com/questions/37189008

复制
相关文章

相似问题

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