第一种方法:

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. flume+kafka

    这里演示在单机fulume环境下,kafka作为source ,chanel , sink时三种情况 下面的测试都是基于下面的基本的配置文件进行修改的 a1.sources = r1 a1.sinks ...

  2. 几种在Linux下查询外网IP的办法。

    几种在Linux下查询外网IP的办法.   Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.ap ...

  3. VSS (Visual Source Safe 2005) 用法详解

    VSS用法指南 The usage of VSS (Visual Source Safe 2005) 1. 首先,当然是得安装好Visual Source Safe 2005 你可以在Visual S ...

  4. 23SpringMvc_各种参数绑定方式-就是<input那种

    本篇博文转载自http://www.cnblogs.com/HD/p/4107674.html: SpringMVC的各种参数绑定方式 1. 基本数据类型(以int为例,其他类似):Controlle ...

  5. Spring Framework 官方文档学习(一)介绍

    http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#overview-maven-bom ...

  6. 【BZOJ】1655: [Usaco2006 Jan] Dollar Dayz 奶牛商店(背包+高精度)

    http://www.lydsy.com/JudgeOnline/problem.php?id=1655 背包就没什么好说的了,裸的完全背包.. 但是我一开始交开了ull都wa了T_T.. 精度太大. ...

  7. 当springMVC 容器初始化完成后执行某个方法

    分类: spring java2013-06-19 16:40 8289人阅读 评论(4) 收藏 举报 在某些应用中,我们希望,当spring 容器将所有的bean都初始化完成后,做一个操作(例如:将 ...

  8. C++之运行时类型识别RTTI

     C++ Code  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 ...

  9. hdu 1667(IDA*)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1667 思路:大牛说是IDA*的入门题=.=构造h()=8-max(1,2,3);  max(1,2,3 ...

  10. Python+selenium之简单介绍unittest单元测试框架

    Python+selenium之简单介绍unittest单元测试框架 一.unittest简单介绍 unittest支持测试自动化,共享测试用例中的初始化和关闭退出代码,在unittest中最小单元是 ...