Grafana弹性数据源找不到时间字段

时间:2018-06-20 07:21:06

标签: elasticsearch datasource grafana

给出以下映射:

{
  "iot_data" : {
    "mappings" : {
      "device_data" : {
        "properties" : {
          "device_id" : {
            "type" : "keyword",
            "cql_collection" : "singleton",
            "cql_partition_key" : true,
            "cql_primary_key_order" : 1
          },
          "nano_since_epoch" : {
            "type" : "long",
            "cql_collection" : "singleton",
            "cql_primary_key_order" : 2
          },
          "sensor_id" : {
            "type" : "keyword",
            "cql_collection" : "singleton",
            "cql_primary_key_order" : 3
          },
          "source" : {
            "type" : "keyword",
            "cql_collection" : "singleton"
          },
          "time" : {
            "type" : "date",
            "cql_collection" : "singleton"
          },
          "unit" : {
            "type" : "keyword",
            "cql_collection" : "singleton"
          }
          "value" : {
            "type" : "double",
            "cql_collection" : "singleton"
          },
          "week_first_day" : {
            "type" : "date",
            "cql_collection" : "singleton",
            "cql_partition_key" : true,
            "cql_primary_key_order" : 0
          }
        }
      }        
    }
  }
}

我正在尝试向grafana添加数据源,但是它一直告诉我没有找到日期字段。我究竟做错了什么? grafana是否无法将“长”字段作为时间字段处理? 自历元以来,我们的数据都在同一毫秒内,这就是为什么要使用nano_seconds的原因。

enter image description here

我知道,grafana需要一个Date字段,如下所示: https://github.com/grafana/grafana/issues/4321#issuecomment-282467390

是否可以通过弹性数据源在x轴上使用非日期字段?

0 个答案:

没有答案