TIme绑定参数命令错误*influxql.StringLiteral不兼容
TIme bind parameter command error *influxql.StringLiteral are not compatible
有人可以指出我在下面的命令中做错了什么吗?
命令:
eCollection=( $(cut -d ',' -f2 new.txt ) )
start= date --utc +%FT%T.%2NZ
sleep 10
end= date --utc +%FT%T.%2NZ
for i in "${eCollection[@]}"
do
var=$((var+1))
if [[ $var -gt 1 ]] ; then
curl -G 'http://localhost:8086/query?db=telegraf' --data-urlencode \
'q=SELECT * FROM '$i' WHERE "time" >= $timebegin AND "time" \
<= $timeend' --data-urlencode \
'params {"timebegin":"${start}","timeend":"${end}"}'
fi
done
错误:
{"results":[{"statement_id":0,"error":"invalid operation: time and *influxql.StringLiteral
are not compatible"}]}
这是一个与字符串处理有关的更新
start=$(date --utc +"%FT%T.%2NZ")
sleep 100
end=$(date --utc +"%FT%T.%2NZ")
startCall='"'$start'"'
endCall='"'$end'"'
echo "$startCall"
echo "$endCall"
for i in "${eCollection[@]}"
do
var=$((var+1))
if [[ $var -gt 1 ]] ; then
echo ${i}
curl -G 'http://localhost:8086/query?db=telegraf' --data-urlencode 'q=SELECT * FROM '$i' WHERE "time" >= $timebegin AND "time" <= $timeend' \
--data-urlencode 'params={"timebegin":'$startCall', "timeend": '$endCall'}'
fi
done
有人可以指出我在下面的命令中做错了什么吗?
命令:
eCollection=( $(cut -d ',' -f2 new.txt ) )
start= date --utc +%FT%T.%2NZ
sleep 10
end= date --utc +%FT%T.%2NZ
for i in "${eCollection[@]}"
do
var=$((var+1))
if [[ $var -gt 1 ]] ; then
curl -G 'http://localhost:8086/query?db=telegraf' --data-urlencode \
'q=SELECT * FROM '$i' WHERE "time" >= $timebegin AND "time" \
<= $timeend' --data-urlencode \
'params {"timebegin":"${start}","timeend":"${end}"}'
fi
done
错误:
{"results":[{"statement_id":0,"error":"invalid operation: time and *influxql.StringLiteral
are not compatible"}]}
这是一个与字符串处理有关的更新
start=$(date --utc +"%FT%T.%2NZ")
sleep 100
end=$(date --utc +"%FT%T.%2NZ")
startCall='"'$start'"'
endCall='"'$end'"'
echo "$startCall"
echo "$endCall"
for i in "${eCollection[@]}"
do
var=$((var+1))
if [[ $var -gt 1 ]] ; then
echo ${i}
curl -G 'http://localhost:8086/query?db=telegraf' --data-urlencode 'q=SELECT * FROM '$i' WHERE "time" >= $timebegin AND "time" <= $timeend' \
--data-urlencode 'params={"timebegin":'$startCall', "timeend": '$endCall'}'
fi
done