filebeat修改索引名字

节点

filebeat版本6.0.0

编辑 filebeat.yml

添加修改如下:

#-------------------------- Elasticsearch output ------------------------------
setup.template.name: "btcfile"      //修改成自己的名字,名字必须小写,大写报错
setup.template.pattern: "btcfile-*"      
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["192.168.1.2:9200"]
index: "btcfile-%{+yyyy.MM.dd}"    //索引

手动加载模块,先关闭logstash,然后指定已elastic输出方式。

filebeat setup --template -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["192.168.1.2:9200"]'

重启filebeat  systemctl restart filebeat

主节点测试:

~]$ curl '192.168.1.3:9200/_cat/indices?v'
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open btcfile-2019.01.30 oYsEaZXQAO2Q7yLPFx03brKjg 3 1 214 0 115.9kb 49.4kb
green open .kibana VTfHCbEuQACAgdUSO5GsO8FZQ 1 1 3 1 47.5kb 23.7kb
green open system-syslog-2019.01 zflaFValeMQ6KN8PrKvjbWVPw 5 1 25577 0 32.1mb 15.9mb

成功。

猜你喜欢

转载自www.cnblogs.com/sunju/p/10338203.html