metricbeat的基本使用

概述

定期收集操作系统或应用服务的指标数据存储到Elasticsearch中,进行实时分析

metricbeat安装

下载页下载,解压即可

metricbeat启动
./metricbeat -e

metricbeat支持的输出类型

  • ElasticSearch
  • LogStash
  • Kafka
  • Redis
  • File
  • Console
  • Cloud

metricbeat也有很多module,需要收集哪个module的信息,即启动该module即可,命令与Filebeat类似

## 查module列表
./metricbeat modules list
## 启用module
./metricbeat modules enable 模块名
## 禁用module
./metricbeat modules disable 模块名

基本属性的配置与Filebeat很类似,不再赘述

案例
举例1:收集系统运行的指标数据至es

启用system模块

./metricbeat modules enable system

system模块收集的数据定义在modules.d/system.yml

metricbeat.yml

metricbeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false

setup.template.settings:
  index.number_of_shards: 1
  index.codec: best_compression
#  #_source.enabled: false

output.elasticsearch:
  hosts: ["http://localhost:9200"]
logging.level: debug

metricbeat数据上传es默认的索引命名规则与filebeat的类似。

查看es文档数据:

在这里插入图片描述

举例2:收集es运行的指标数据至es

与之前类似,启用elasticsearch模块,配置文件与上例一致。

查看es文档数据:

在这里插入图片描述

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值