博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ELK多行日志收集
阅读量:6940 次
发布时间:2019-06-27

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

版本:filebeat5.2.2

日志如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
192.168.1.187 [10.10.2.5,192.168.2.2,192.168.3.4] [2017-03-05 00:01:00] ["POST www.test.com/Service.asmx"] [""1.0" encoding="utf-8"?><soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"><soap12:Body><SaveException xmlns="http://tempuri.org/"><Content>java.lang.UnsatisfiedLinkError: Native method not found: com.igexin.push.extension.mod.SecurityUtils.m:([B[B)[B
        
at com.igexin.push.extension.mod.SecurityUtils.m(Native Method)
        
at com.igexin.push.util.EncryptUtils.altAesDecSocket(Unknown Source)
        
at com.igexin.push.d.a.c.a(Unknown Source)
        
at com.igexin.push.d.a.c.b(Unknown Source)
        
at com.igexin.push.d.a.c.a(Unknown Source)
        
at com.igexin.push.d.a.c.b(Unknown Source)
        
at com.igexin.push.d.a.c.c(Unknown Source)
        
at com.igexin.a.a.b.a.a.j.a_(Unknown Source)
        
at com.igexin.a.a.d.g.a(Unknown Source)
        
at com.igexin.a.a.d.g.run(Unknown Source)
        
at java.lang.Thread.run(Thread.java:841)
</Content><Mobile>561128</Mobile><Source>android</Source></SaveException></soap12:Body></soap12:Envelope>"]  ["Dalvik/1.6.0 (Linux; U; Android 4.4.4; SM-G8508S Build/KTU84P)"] ["java\.lang"]

如果不作任何处理,filebeat会把每行日志作为一条数据传输给redis,这样elasticsearch收集到数据就无法把日志分类了。所有必须让filebeat把上面的这条日志当成一条数据传输给redis。

vim filebeat.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#=========================== Filebeat prospectors =====
filebeat.prospectors:
#------------------------------ Log prospector --------
- input_type: log
paths:
    
- c:\programdata\elasticsearch\logs\*
     
multiline.pattern: ^\d+\.\d+
     
#日志开头以“数字.数字”的格式开头,不是以此开头的日志计算上一行日志
multiline.negate: true
multiline.match: after
#------------------------------- Redis output --------
output.redis:
  
enabled: true
  
hosts: ["192.168.10.10:6379"]
  
port: 6379
  
key: log
  
db: 2
  
datatype: list
  
worker: 2
    
  
loadbalance: true
  
logging.to_files: true
  
logging.files:
本文转自 irow10 51CTO博客,原文链接:http://blog.51cto.com/irow10/1904664,如需转载请自行联系原作者
你可能感兴趣的文章
js call
查看>>
centos6.2-64位快速部署hadoop-1.0.4.tar.gz 和 jdk-7u17-linux-x64.tar.gz
查看>>
004-关闭文件后自动备份
查看>>
js实现当前导航菜单高亮显示
查看>>
Linux常用命令(二)--文件目录命令
查看>>
tomcat启动报错
查看>>
由《旧制度与大革命》提取的5个感触
查看>>
sqlserver 分页
查看>>
php通过system()调用Linux命令问题
查看>>
swift 警告框 - 自定义按钮颜色,图片
查看>>
提高搜索引擎结果页面排名的各种技术
查看>>
刷题常用的STL容器总结
查看>>
创建一个支持ES6的Nodejs项目
查看>>
sqlserver 行转列、字符串行转列、自动生产行转列脚本
查看>>
仿微信表情输入
查看>>
慎用dictionaryWithObjectsAndKeys方法
查看>>
兼容FF IE的回车事件
查看>>
冒泡排序,快速排序, 二叉树,一致性哈希
查看>>
sdut 1451 括号东东 (dp或模拟)
查看>>
POJ1002 487-3279
查看>>