2016-09-15 193 views
0

我試圖將Zabbix日誌數據提供給ELK堆棧以執行一些時序關聯。然而,我沒有得到我的Logstash中央服務器配置指定的過濾器,如果它充當代理的話。我正在使用Filebeat將日誌條目發送到Logstash進行處理。但是,行沒有被Logstash確認,但在Elasticsearch/Kibana中可見。這是我的配置。Logstash無法基於Filebeat的字段進行有條件篩選

filebeat: 
    prospectors: 
    - 
     paths: 
     - /var/log/zabbix/zabbix_proxy.log 
     input_type: log 
     fields: 
     tags: ["zabbix", "zabbix-proxy"] 
    registery_file: /var/lib/filebeat/registry 
output: 
    logstash: 
    hosts: ["elkls.com:5044"] 
logging: 
    files: 
    rotateeverybytes: 12345656 

然後我Logstash配置文件

input { 
    beats { 
    port => 5044 
    } 
} 
filter { 
    if "zabbix" in [fields.tags] { 
    grok { 
     match => { 
     "message" => { 
      "filter stuff here" 
     } 
     } 
    } 
    } 
} 
output { 
    elasticsearch { 
    hosts => [ "elkhost.com:9200"] 
    } 
} 

Logstash不作用在fields.tags線,和過濾/切割了日誌行被傳遞給它從Filebeat。我是否正確訪問這些變量?我做了與其他文件類似的事情,但只有當Logstash充當代理,並直接從文件中讀取時。

回答