Logstash filebeat将日志直接发送到弹性搜索,而不是日志存储

Logstash filebeat将日志直接发送到弹性搜索,而不是日志存储,logstash,elastic-stack,filebeat,Logstash,Elastic Stack,Filebeat,我面临这个问题,因为我已经删除了所有索引。为此,我执行了以下命令 curl -XDELETE 'http://localhost:9200/*' filebeat.yml filebeat: prospectors: - paths: - /var/log/syslog - input_type : log document_type: syslog registry_file: /var/lib/filebeat/registry

我面临这个问题,因为我已经删除了所有索引。为此,我执行了以下命令

curl -XDELETE 'http://localhost:9200/*' 
filebeat.yml

filebeat:
  prospectors:
    -
     paths:
      - /var/log/syslog
    - input_type : log
      document_type: syslog
  registry_file: /var/lib/filebeat/registry
output:
  logstash:
    hosts: ["127.0.0.1:5044"]
    bulk_max_size: 1024

shipper:
logging:
  files:
    rotateeverybytes: 10485760 # = 10MB
和日志存储配置文件输入配置

   input {
      beats {
        port => 5044
      }
    }
  output {
      elasticsearch {
        hosts => ["localhost:9200"]
        sniffing => true
        manage_template => false
        index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
        document_type => "%{[@metadata][type]}"
      }
    }
和输出配置

   input {
      beats {
        port => 5044
      }
    }
  output {
      elasticsearch {
        hosts => ["localhost:9200"]
        sniffing => true
        manage_template => false
        index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
        document_type => "%{[@metadata][type]}"
      }
    }

问题是日志不是通过logstash来的,这些是直接来的,因为我看不到kibana中添加的新字段,并且在apche访问日志的情况下,只有类型为的log as值。

如配置文件所示,您已经注释掉了elasticsearch输出配置。因此,您收到的输出不是因为elasticsearch,而是因为logstash。您已将其添加为注释,但应执行以下操作:

elasticsearch:
# Array of hosts to connect to.
# Scheme and port can be left out and will be set to the default (http and 9200)
# In case you specify and additional path, the scheme is required: http://localhost:9200/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:9200
   hosts: ["localhost:9200"]

您可能只是在Filebeat配置中出现语法错误,请尝试更改

 - input_type : log


通过声明第二个浏览者,
-
肯定会弄乱您的配置。如果您的所有日志存储处理都是按类型完成的,那么您输入的不正确的日志将通过日志存储发送到elasticsearch,而不进行任何解析。

以后,请从您要发送到日志存储的configOP中删除所有注释,特别是不直接elastic@WillBarnwelllogstash具有将日志输出到elastic search的配置,因此,如果logstash没有接收任何数据,elasticsearch为什么会接收数据?我从最初的问题中推断出,用户希望有两个输出,一个通过弹性搜索,另一个通过logstash。如果我删除-那么我得到了文件加载错误@will,并且我已经在logstashhello@will中放置了类型的过滤器,感谢这也是问题所在,以及filebeat.yml中的其他间距问题拆下后工作-