Created
December 29, 2016 10:21
-
-
Save imweijh/2e0a74afd9a8c4ef1140bc742e20ea9c to your computer and use it in GitHub Desktop.
重启logstash并删除metrics索引的脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 用kibana展示metric.count最新值的方法:每天凌晨删除相关index,并重启logstash清空metrics事件,然后kibana取该字段的最大值... | |
/bin/sed -i -r "s/$(date '+%Y%m%d' -d "1 day ago")/$(date '+%Y%m%d')/g" /etc/logstash/conf.d/logstash2.conf | |
/usr/bin/curl --noproxy "*" -XDELETE localhost:9200/metric-* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment