当您自定义debian系统上的文件节拍日志收集规则时,您可以按照以下步骤操作:
1。filebeat
请先安装并确保安装文件beat。 如果未安装,您可以使用以下命令安装它:FileBeat
通常在/etc/filebeat/filebeat.yml中找到用于配置FileBeat的配置文件。 您可以编辑此文件以自定义日志集合规则。
2.1基本配置
open filebeat.yml文件:
sudo nano/etc/etc/filebeat/filebeat.yml
2.2在filebeat.inputs intups infuts intups infilebeat.inputs中设置日志路径
。 Example:
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/*.log [/var/log/myapp/*.log"
Field: Application: MyApp Environment: Production 2.4 Processors
You can change log events using the processor. For example, add a处理器并提取JSON字段。“值”
- decode_json_fields:
字段:[“消息”]
目标:“”“
operwrite_keys:true
2.5输出
配置filebeat以将filebeat发送到filebeat向Elasticsearch或logstash或logstash或logstash或logstash或logStash:
p> p>“ filebeat-% - %} [ymmM}+y.yy}+y。
3。启动并启用文件beat
在文件后保存并关闭filebeat.yml,将其设置为启动并打开功能。调试,您可以使用以下命令:随着时间的推移,您需要根据新的日志格式或要求更新配置文件。您的特定需求。
以上内容来自互联网,并不代表本网站的所有视图! 关注我们:zhujipindao .com
评论前必须登录!
注册