作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 InfluxDB 的新手,问题在于我必须通过 Nifi 在 InfluxDB 中插入 python 字典,我尝试了不同的方法,但我总是遇到同样的错误,告诉我标签丢失了:
org.influxdb.InfluxDBException: {
"error": "unable to parse '[
{
"measurement": "sensor",
"time": 1559560006,
"tags": [
"sensor",
"id",
"date",
"info",
"aleatory_number",
"aleatory_number_square_root"
],
"fields": {
"id": 8,
"date": 1559559961002,
"info": "info sensor8",
"aleatory_number": 1778687859,
"aleatory_number_square_root": 42174.492
}
}
]': missing tag value"
}
另一个例子:
{
"error":"unable to parse
'[{
"measurement":"sensor",
"time":1559630455,
"tags":{"test_tag":"test"},
"fields":{}
}]'
: missing tag value"
}
另一个:
org.influxdb.InfluxDBException:
{
"error":"unable to parse
'[{
"measurement":"sensor",
"time":1559631341,
"tags":{},
"fields":{}
}]'
: missing tag value"}
我最后一次尝试遵循这个 avro 模式:
{
"type": "record",
"name": "preprocessed_value",
"fields": [
{ "name": "measurement", "type": "string" },
{ "name": "time", "type": "long" },
{ "name": "tags", "type": { "type":"map", "values" : "string"} },
{
"name" : "fields" ,
"type" : {
"name" : "PythonDict",
"type" : "record",
"fields": [
{ "name": "id", "type": "int" },
{ "name": "date", "type": "long" },
{ "name": "info", "type": "string" },
{ "name": "aleatory_number", "type": "long" },
{ "name": "aleatory_number_square_root", "type": "float" }
]
}
}
]
}
我同时使用标签和字段时遇到了同样的错误:
org.influxdb.InfluxDBException: {"error":"unable to parse
'[{
"measurement":"sensor",
"time":1559720142,
"tags":{"test_tag":"test"},
"fields":{
"id":3,
"date":1559718332366,
"info":"info sensor3",
"aleatory_number":141969819,
"aleatory_number_square_root":11915.108
}
}]': missing tag value"}
最佳答案
如果您尝试插入测量“传感器”的记录(根据 InfluxDB 术语的点)没有值或任何标签的值为空,您将收到此错误。
我不确定,为什么您的测量具有几乎相似的标签和字段。对于一个点,标签列是必填数据,字段列是可选的。
在 influx cli 上执行以下命令:
show tag keys from sensor;
这将列出您的测量中所有标记的列。确保在尝试插入新点时传递所有这些。
关于python - InfluxDB 缺少标签值(putInfluxDB nifi 处理器),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56426288/
我是 InfluxDB 的新手,问题在于我必须通过 Nifi 在 InfluxDB 中插入 python 字典,我尝试了不同的方法,但我总是遇到同样的错误,告诉我标签丢失了: org.influxdb
我是一名优秀的程序员,十分优秀!