2016-05-12 66 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部分增加工人數量

相關問題