博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
filebeat___log -input
阅读量:3964 次
发布时间:2019-05-24

本文共 1251 字,大约阅读时间需要 4 分钟。

1.exclude_lines

filebeat.inputs:- type: log   paths:    - /var/log/system.log    - /var/log/wifi.log- type: log   paths:    - "/var/log/apache2/*"  exclude_lines: ['^DBG']  #删除以DBG开头的任何行  fields:           apache: true   #使用fields配置选项将名为apache的字段添加到输出中。  fields_under_root: true

2.include_lines:

Filebeat只导出与列表中正则表达式匹配的行。默认情况下,将导出所有行。忽略空行。

以下示例将Filebeat配置为导出以ERR或WARN开头的任何行:

filebeat.inputs:- type: log   paths:    - /var/log/system.log    - /var/log/wifi.log- type: log   paths:    - "/var/log/apache2/*"  include_lines: ['^ERR', '^WARN'] #  fields:           apache: true   #使用fields配置选项将名为apache的字段添加到输出中。  fields_under_root: true

3.同时有include_lines和exclude_lines

如果同时定义了include_ line和exclude_line行,则Filebeat首先执行include_ line,然后执行exclude_line行。这两个选项的定义顺序并不重要。include\u lines选项将始终在exclude_ lines选项之前执行,即使exclude_ lines出现在配置文件的include_ line之前。

以下示例导出包含sometext的所有日志行,但以DBG(调试消息)开头的行除外:

filebeat.inputs:- type: log   paths:    - /var/log/system.log    - /var/log/wifi.log- type: log   paths:    - "/var/log/apache2/*"  include_lines: ['sometext']  exclude_lines: ['^DBG']  fields:           apache: true   #使用fields配置选项将名为apache的字段添加到输出中。  fields_under_root: true

4.exclude_files

希望Filebeat忽略的文件匹配的正则表达式列表。默认情况下不排除任何文件。

以下示例将Filebeat配置为忽略具有gz扩展名的所有文件:
在这里插入图片描述

转载地址:http://bngzi.baihongyu.com/

你可能感兴趣的文章
Spring 配置数据库动态密码
查看>>
Spring 申明式事务之注解
查看>>
Spring 申明式事务之XML模式
查看>>
Spring 程序式事务管理
查看>>
Spring JdbcTemplate
查看>>
Spring NamedParameterJdbcTemplate
查看>>
JMS + ActiveMQ 精萃
查看>>
ActiveMQ 下载和安装
查看>>
JMS 点对点消息
查看>>
JMS 发布/订阅消息 -- 同步
查看>>
正则表达式精萃
查看>>
正则表达式简介
查看>>
匹配任何字符:点号(.)
查看>>
匹配行的起始(^)和结束($)
查看>>
Java SE 精萃
查看>>
Java 白皮书
查看>>
在Windows XP中安装Java SE
查看>>
使用记事本(Notepad)开发一个 hello world 程序
查看>>
Java语言规范
查看>>
字符组
查看>>