32 lines
991 B
Plaintext
32 lines
991 B
Plaintext
# fluentd/conf/fluent.conf
|
||
<source>
|
||
@type forward # source表示日志源来自转发,forward与http是默认安装的组件,不需要额外的插件支持。
|
||
port 24224 # 在24224端口启动forward接收转发
|
||
bind 0.0.0.0 # 允许接收任意IP的转发
|
||
</source>
|
||
|
||
<match *.**>
|
||
@type copy
|
||
<store>
|
||
@type elasticsearch # 转发日志到es,这需要安装es的插件
|
||
host elasticsearch # es的配置信息
|
||
port 9200
|
||
index_name fluentd
|
||
logstash_format true # 启动转发
|
||
logstash_prefix fluentd-${tag} # 转发到es的索引名称
|
||
logstash_dateformat %Y.%m # 按月来划分索引,可以删除无用数据
|
||
include_tag_key true
|
||
type_name application_log
|
||
tag_key @log_name
|
||
reconnect_on_error true
|
||
reload_on_failure true
|
||
reload_connections false
|
||
<buffer>
|
||
flush_interval 2s # 每2s刷新一次
|
||
</buffer>
|
||
</store>
|
||
<store>
|
||
@type stdout # 搜索到数据后立即转发到es
|
||
</store>
|
||
</match>
|