在官方有说明:
logstash_format
logstash_format true # defaults to false
This is meant to make writing data into Elasticsearch indices compatible to what Logstash calls them. By doing this, one could take advantage of Kibana. See logstash_prefix and logstash_dateformat to customize this index name pattern. The index name will be #{logstash_prefix}-#{formated_date}
:warning: Setting this option to true
will ignore the index_name
setting. The default index name prefix is logstash-
.
fluentd的配置如下:
# In v1 configuration, type and id are @ prefix parameters.
# @type and @id are recommended. type and id are still available for backward compatibility
## built-in TCP input
## $ echo <json> | fluent-cat <tag>
<source>
@type forward
@id forward_input
</source>
## built-in UNIX socket input
#<source>
# @type unix
#</source>
# HTTP input
# http://localhost:8888/<tag>?json=<json>
<source>
@type http
@id http_input
port 8888
</source>
## File input
## read apache logs with tag=apache.access
#<source>
# @type tail
# format apache
# path /var/log/httpd-access.log
# tag apache.access
#</source>
## Mutating event filter
## Add hostname and tag fields to apache.access tag events
#<filter apache.access>
# @type record_transformer
# <record>
# hostname ${hostname}
# tag ${tag}
# </record>
#</filter>
## Selecting event filter
## Remove unnecessary events from apache prefixed tag events
#<filter apache.**>
# @type grep
# include1 method GET # pass only GET in 'method' field
# exclude1 message debug # remove debug event
#</filter>
# Listen HTTP for monitoring
# http://localhost:24220/api/plugins
# http://localhost:24220/api/plugins?type=TYPE
# http://localhost:24220/api/plugins?tag=MYTAG
<source>
@type monitor_agent
@id monitor_agent_input
port 24220
</source>
# Listen DRb for debug
<source>
@type debug_agent
@id debug_agent_input
bind 127.0.0.1
port 24230
</source>
## match tag=apache.access and write to file
#<match apache.access>
# @type file
# path /var/log/fluent/access
#</match>
## match tag=debug.** and dump to console
<match debug.**>
@type stdout
@id stdout_output
</match>
# match tag=system.** and forward to another fluent server
<match system.**>
@type forward
@id forward_output
<server>
host 192.168.0.11
</server>
<secondary>
<server>
host 192.168.0.12
</server>
</secondary>
</match>
## match tag=myapp.** and forward and write to file
#<match myapp.**>
# @type copy
# <store>
# @type forward
# buffer_type file
# buffer_path /var/log/fluent/myapp-forward
# retry_limit 50
# flush_interval 10s
# <server>
# host 192.168.0.13
# </server>
# </store>
# <store>
# @type file
# path /var/log/fluent/myapp
# </store>
#</match>
## match fluent's internal events
#<match fluent.**>
# @type null
#</match>
## match not matched logs and write to file
#<match **>
# @type file
# path /var/log/fluent/else
# compress gz
#</match>
## Label: For handling complex event routing
#<label @STAGING>
# <match system.**>
# @type forward
# @id staging_forward_output
# <server>
# host 192.168.0.101
# </server>
# </match>
#</label>
######以下可以能过匹配的tag (elk)写入到elasticsearch
<match elk.**>
@type elasticsearch
host localhost
port 9200
logstash_format true
</match>
######tail 收集日志开始
<match golang.**>
@type elasticsearch
host localhost
port 9200
index_name fluentd.${tag}
logstash_format false ##更改为false就不会成生logstash-2019.02.19这样子的
flush_interval 1s
</match>
<source>
@type tail
format json
path /var/log/test.log
tag golang.access
</source>
#######tail 收集日志结束
搜索
标签
study
ab
amap
apache
apahe
awk
aws
bat
centos
CFS
chrome
cmd
cnpm
composer
consul
crontab
css
curl
cygwin
devops
di
docker
docker,docker-compose
ethereum
excel
fiddler
fluentd
framework
front-end
git
gitgui
github
glide
go
golang
gorm
grafana
gzip
ioc
item2
iterm2
javascript
jenkins
jsonp
kafka
laradock
laravel
larval
linux
liunux
log
mac
mac, wi-fi
macos
magento
mariaDB
minikube
mongoDB
msp
mysql
netbeans
nginx
nodejs
nohup
npm
nsq
php
php-fpm
php7
phpstorm
php扩展
Protobuf
python
redis
scp
server
shell
soap
socket
socket5
sql
sre
ssdb
ssh
ssl
study
sublime
swift
system
td-agent
uml
v2ray
vagrant
vagrnat
vim
vpn
vue
vue.js
webpack
webrtc
websocket
webtatic
windows
windows7
word
wps
xdebug
yarn
yii2
yum
zookeeper
世界国家
互联网
以太坊
分类
前端
小程序
打印机
排序算法
搞笑
权限
粤语
缓存
网络
虚拟机
视频
设计模式
项目管理
热门文章
友情链接