fluent-bit是一种在Linux,OSX和BSD系列操作系统运行,兼具快速、轻量级日志处理器和转发器。它非常注重性能,通过简单的途径从不同来源收集日志事件。?
1.编写fluent-bit配置文件
fluent-bit-json.conf
[SERVICE]
Flush 1
Daemon off
Log_Level info
parsers_file parsers_multiline.conf
[INPUT]
name tail
path /Users/icefox/Documents/fluent-bit/log/*.log
Read_from_Head false
multiline.parser multiline-regex-test
Buffer_Chunk_Size 2m
buffer_max_size 30m
Refresh_Interval 10
Mem_Buf_Limit 32m
Rotate_Wait 5
DB.Sync Normal
Path_Key fbKey
db /Users/icefox/Documents/fluent-bit/log.db
#[OUTPUT]
# name stdout
# match *
[OUTPUT]
Name http
Match *
Host 127.0.0.1
Port 8080
URI /json
Format json
parsers_multiline.conf?
[MULTILINE_PARSER]
name multiline-regex-test
type regex
flush_timeout 1000
#
# Regex rules for multiline parsing
# ---------------------------------
#
# configuration hints:
#
# - first state always has the name: start_state
# - every field in the rule must be inside double quotes
#
# rules | state name | regex pattern | next state
# ------|---------------|--------------------------------------------
rule "start_state" "/(\d+ \d+\:\d+\:\d+)(.*)/" "cont"
rule "cont" "/^\s+at.*/" "cont"
2.执行启动?
fluent-bit -c ./fluent-bit-json.conf
3.编写日志接收接口
|