2016-05-12 70 views
1

我已经配置filebeat,因为它是在elastic.cofilebeat不转发到logstash

的问题descripted是,当我添加一个新的日志文件中的数据不被上传到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}" 
    } 
} 

回答

1

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

如果你想使用Logstash对由Filebeat收集的数据 执行额外的处理,则需要Filebeat配置为使用 Logstash。

要做到这一点,您可以编辑Filebeat配置文件,通过注释掉它禁用 Elasticsearch输出,并通过取消注释logstash部分

0

您可以检查工人数在filebeat使Logstash 输出。 yml如下?

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

你应该在logstash部分增加工人数量

相关问题