gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 19:39:50 25 4
gpt4 key购买 nike

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

当我看到 Elasticsearch 中最终出现的新整体时,基础知识似乎有效,但它们看起来都是错误的。我的理论是,Logstash 配置为解析 Gattle 日志,但 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

关于logstash - 如何检查 Filebeat 发送到 Logstash 的内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40788343/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com