第一种方法:

vim /etc/filebeat/filebeat.yml

filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations. - type: log # Change to true to enable this input configuration.
enabled: true
harvester_limit: 100
#close_eof : true
close_inactive : 10m
#close_timeout : true
ignore_older : 72h
clean_inactive : 73h
scan_frequency: 10s
# Paths that should be crawled and fetched. Glob based paths.
json.keys_under_root: true
paths:
- /etc/logs/*.log
- /var/www/logs/*.logs

  

第二种方法,增加个tag字段,区分不同地方的log,建议使用

- type: log

  # Change to true to enable this input configuration.
#enabled: false
enabled: true
harvester_limit: 100
close_inactive: 10m
ignore_older: 168h
clen_inactive: 170h
scan_frequency: 10s
json.keys_under_root: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /var/log/*.log
tags: ["all"] - type: log # Change to true to enable this input configuration.
#enabled: false
enabled: true
harvester_limit: 100
close_inactive: 10m
ignore_older: 168h
clen_inactive: 170h
scan_frequency: 10s
json.keys_under_root: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /opt/logs/test.log
tags: ["only_test"]

  

filebeat配置不同路径下的log的两种方法的更多相关文章

  1. SQL Server中灾难时备份结尾日志(Tail of log)的两种方法

    转自:http://www.cnblogs.com/CareySon/archive/2012/02/23/2365006.html SQL Server中灾难时备份结尾日志(Tail of log) ...

  2. 20155212 C语言实现linux下pwd命令的两种方法

    20155212 C语言实现linux下pwd命令的两种方法 学习pwd命令 通过man pwd命令查看 pwd [OPTION],一般不加参数 -P显示当前目录的物理路径 -L显示当前目录的连接路径 ...

  3. Linux 下操作GPIO(两种方法,驱动和mmap)(转载)

    目前我所知道的在Linux下操作GPIO有两种方法: 1.编写驱动,这当然要熟悉Linux下驱动的编写方法和技巧,在驱动里可以使用ioremap函数获得GPIO物理基地址指针,然后使用这个指针根据io ...

  4. Linux 下操作gpio(两种方法,驱动和mmap)

    目前我所知道的在linux下操作GPIO有两种方法: 1.  编写驱动,这当然要熟悉linux下驱动的编写方法和技巧,在驱动里可以使用ioremap函数获得GPIO物理基地址指针,然后使用这个指针根据 ...

  5. suse下设置IP的两种方法

    /Files/yzhxhwt/DB_51aspx.rar 第一种SUSE Linux IP设置方法ifconfig eth0 192.168.1.22 netmask 255.255.255.0 up ...

  6. spring boot 下websocket实现的两种方法

    websocket前台实现代码,保存为html执行就好 html代码来自:https://blog.csdn.net/M348915654/article/details/53616837 <h ...

  7. Centos6、7下安装Nginx的两种方法

    一,通过yum命令安装 1.操作系统版本的确认很重要,因为下一步我们要依靠这个来创建yum源文件 2.创建 nginx.repo vi /etc/yum.repos.d/nginx.repo 文件内容 ...

  8. 上拉刷新和下拉刷新的两种方法(包括使用第三方库MJRefresh)

    一.使用苹果原生的方法 1.下拉刷新 2.上拉刷新 (1 首先要新建一个footer得XIB文件,当然同时包括对应的控制器文件,例如在XIB文件中可以如下拖拉对应的控件 (2 然后在代码文件中写一个实 ...

  9. Android下打印堆栈的两种方法

    1. for(StackTraceElement i:Thread.currentThread().getStackTrace()){ System.out.println(i); } 2. Log. ...

随机推荐

  1. 转:PHP获取浏览器类型及版本号

    function getBrowser(){ $agent=$_SERVER["HTTP_USER_AGENT"]; if(strpos($agent,'MSIE')!==fals ...

  2. const成员或者引用成员必须使用构造函数初始化列表的方式

    #include<iostream.h> class A { const int a; int b; }; void main() { A obja; }编译出现如下错误:error C2 ...

  3. C++ new delete操作符

    //new delete操作符 #define _CRT_SECURE_NO_WARNINGS #include<iostream> using namespace std; /* 1.n ...

  4. MyBatis 本是apache的一个开源项目iBatis

    MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation 迁移到了google code,并且改名为MyBatis .20 ...

  5. php -- 文件操作类(文件或文件夹的:创建、删除、复制、移动)

    <? /** * 操纵文件类 * * 例子: * FileUtil::createDir('a/1/2/3'); 测试建立文件夹 建一个a/1/2/3文件夹 * FileUtil::create ...

  6. GitHub Permission to <<repository>> denied to <<username>>

    I kept receiving a 403 error saying my usual username couldn’t access the repository with my usual a ...

  7. 通过公网IP主机建立ssh隧道

    环境描述 hostA: 有公网IP的linux主机 hostB: 私有路由器后端无公网IPlinux主机,能够ssh连接到hostA hostC: 个人pc机 隧道创建步骤 step1 在hostB上 ...

  8. HttpModule的简单示例

    1.HttpModule可用在asp.net 管线事件触发的过程中.. 可处理一些通用的操作,如给特定请求加 gzip压缩. 2.示例代码: using System; using System.We ...

  9. 原生YII2 增删改查的一些操作(非ActiveRecord)

    1.添加数据 如下,使用insert方法:t_admin_user为数据表名..其他的是属性.. $num = Yii::$app->db->createCommand()->ins ...

  10. mulitp request

    1.设置cookie 2.设置header 3.通过requst.getInputStream(); 4.通过request.getsession();