Skip to content

Instantly share code, notes, and snippets.

@imweijh
Created December 29, 2016 10:21
Show Gist options
  • Save imweijh/2e0a74afd9a8c4ef1140bc742e20ea9c to your computer and use it in GitHub Desktop.
Save imweijh/2e0a74afd9a8c4ef1140bc742e20ea9c to your computer and use it in GitHub Desktop.
重启logstash并删除metrics索引的脚本
# 用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