在这个链接中,我们可以将数据导入到KairosDB中:this link
>bin/kairosdb.sh import -f export.txt
If you happened to compress the export you can pipe it back into the system like this:
>gzip -dc export.gz | bin/kairosdb.sh import我不确定export.txt文件应该是什么格式
我有一个类似如下的文件(export.txt):
Building_id,building_type,meter_type,unit,timestamp,value
1,Elementary School,temperature,F,1359695700,34.85
2,Park,temperature,F,1359695700,0
3,Industrial,temperature,F,1359695700,0.07
4,Recreation Center,temperature,F,1359695700,0
5,Park,temperature,F,1359695700,2.2
6,Community Center,temperature,F,1359695700,31.41
7,Office,temperature,F,1359695700,0
8,Elementary School,temperature,F,1359695700,10.88
9,Elementary School,temperature,F,1359695700,42.27
.
.我想把这些数据批量插入到kairosDB中,我该怎么做呢?
发布于 2015-08-11 19:37:42
导入/导出功能使用JSON格式,有点类似于通过REST API发送到推送数据的格式(c.f.http://kairosdb.github.io/kairosdocs/restapi/AddDataPoints.html )。每行一个JSON文档。
{
"name": "kairosdb.jvm.free_memory",
"tags": {
"host": "TTES"
},
"datapoints": [
[
1438184280003,
850322752
],
[
1438184281003,
850322753
]
]
}AFAIK import命令旨在导入以前使用export命令转储的数据,而不是使用新数据填充数据库(您可能更喜欢使用telnet或REST接口)。
https://stackoverflow.com/questions/31923218
复制相似问题