1. 简介
- Data Shipper
- ETL
- Extract
- Transform
- Load
- Logstash is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your favorite "stash".
2. 处理流程
- Input
- file
- redis
- beats
- kafka
- Filter
- grok表达式
- 基于正则表达式提供了丰富可重用的模式(pattern)
- 基于此可以将非结构化数据作结构化处理
- mutate 数据类型转换
- 进行增加、修改、删除、替换等字段相关的处理
- drop
- date
- 将字符串类型的时间字段转换为时间戳类型,方便后续数据处理
- Output
- stdout
- elasticsearch
- redis
- kafka
- Input和Output简单配置
- input{file{path => "/tmp/abc.log"}}
- output{stdout{codec => rubydebug}}
- Filter配置Grok示例
- 非结构化数据: 127.0.0.1 GET /index.html 15824 0.033
- Grok表达式: %{IP:client} %{WORD:method} %{URIPATHPARAM:request} %{NUMBER:bytes} %{NUMBER:duration}