Grafana配置es数据源

ES版本:elasticsearch-7.15.2

Grafana版本:grafana-8.1.2

Mac安装ES

安装es参考Install Elasticsearch from archive on Linux or MacOS | Elasticsearch Guide [7.15] | Elastic


建议:指定data和logs目录

启动

cd elasticsearch-7.15.2;./bin/elasticsearch -d -p pid

验证

curl http://localhost:9200

响应信息

{
  "name" : "MacBook-Pro.local",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "A5JGCshoT-uoYKVyy6L5Xw",
  "version" : {
    "number" : "7.15.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "93d5a7f6192e8a1a12e154a2b81bf6fa7309da0c",
    "build_date" : "2021-11-04T14:04:42.515624022Z",
    "build_snapshot" : false,
    "lucene_version" : "8.9.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

插入数据到ES

curl -XPUT "http://localhost:9200/twitter/tweet/1"; -H 'Content-Type: application/json' -d'
{
    "user" : "kimchy",
    "post_date" : "2021-11-10T14:12:12",
    "message" : "trying out Elasticsearch"
}'

curl -XPUT "http://localhost:9200/twitter/tweet/2"; -H 'Content-Type: application/json' -d'
{
    "user" : "kimchy2",
    "post_date" : "2021-11-11T01:45:12",
    "message" : "trying out Elasticsearch"
}'

curl -XPUT "http://localhost:9200/twitter/tweet/3"; -H 'Content-Type: application/json' -d'
{
    "user" : "kimchy3",
    "post_date" : "2021-11-11T01:45:12",
    "message" : "trying out Elasticsearch"
}'

配置Grafana数据源

  

post_date在插入数据的时候,指定为"2021-11-10T14:12:12" 格式时,在配置数据源中可识别。默认时间为UTC时间。

数据展示

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值