如何检查Filebeat发送到Logstash的内容?

如何检查Filebeat发送到Logstash的内容?,logstash,elastic-stack,filebeat,Logstash,Elastic Stack,Filebeat,我已经将Logstash配置为直接拾取文件(日志),使用自定义逻辑处理它们,然后发送到Elasticsearch。它工作得很好。我现在正在尝试设置Filebeat以将文件发送到它 当我看到新的entires最终出现在Elasticsearch中时,基本原理似乎起了作用,但它们看起来都错了。我的理论是,Logstash配置为解析Gatling日志,但Filebeat不直接发送日志,而是发送一些JSON或其他包含元数据的格式,而Logstash需要重新配置以解析此日志 但是。。。如何找出Filebe

我已经将Logstash配置为直接拾取文件(日志),使用自定义逻辑处理它们,然后发送到Elasticsearch。它工作得很好。我现在正在尝试设置Filebeat以将文件发送到它

当我看到新的entires最终出现在Elasticsearch中时,基本原理似乎起了作用,但它们看起来都错了。我的理论是,Logstash配置为解析Gatling日志,但Filebeat不直接发送日志,而是发送一些JSON或其他包含元数据的格式,而Logstash需要重新配置以解析此日志


但是。。。如何找出Filebeat发送的内容?格式是否有文档记录?

将设置添加到filebeat.yml

您可以在路径中将输出日志作为文件查看发生了什么

output.file:
# Boolean flag to enable or disable the output module.
enabled: true

# Path to the directory where to save the generated files. The option is
# mandatory.
path: "your path"

# Name of the generated files. The default is `filebeat` and it generates
# files: `filebeat`, `filebeat.1`, `filebeat.2`, etc.
filename: filebeat

# Maximum size in kilobytes of each file. When this size is reached, and on
# every filebeat restart, the files are rotated. The default value is 10240
# kB.
#rotate_every_kb: 10000

# Maximum number of files under path. When this number of files is reached,
# the oldest file is deleted and the rest are shifted from last to first. The
# default is 7 files.
number_of_files: 7
如果要查看网络设置

请添加设置以查看日志

logging.level: warning
logging.to_files: true
logging.to_syslog: false
logging.files:
  path: /var/log/mybeat
  name: mybeat.log
  keepfiles: 7

这回答了你的问题吗?@baudsp。它解释了元数据部分,但没有解释实际消息(文件内容)的去向。或者也许我看错了这一切:(不知道这可能在哪里。可能您的输入上有一个会导致问题的编解码器。请确保您在日志存储配置中使用的是
beats
输入,并且没有对该输入应用编解码器。日志行发送到
message
字段。发布您的Filebeat和Logstash配置会有所帮助。