日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

使用curl操作InfluxDB

發(fā)布時間:2025/7/14 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用curl操作InfluxDB 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

這里列舉幾個簡單的示例代碼,更多信息請參考InfluxDB官方文檔:?https://docs.influxdata.com/influxdb/v1.1/

環(huán)境: CentOS6.5_x64
InfluxDB版本:1.1.0

  • 創(chuàng)建數(shù)據(jù)庫

  curl -i -XPOST http://localhost:8086/query --data-urlencode "q=create database testdb"

  • 寫入數(shù)據(jù)

  1、不帶時間戳  

  curl -i -XPOST 'http://localhost:8086/write?db=testdb' --data-binary 'students,stuid=s123 score=89'

  2、帶時間戳

  curl -i -XPOST 'http://localhost:8086/write?db=testdb' --data-binary 'students,stuid=s123 score=89 1434055562000000000'

  • 查詢數(shù)據(jù)

  1、使用時間字符串(會進行時區(qū)轉(zhuǎn)換)

  curl -G 'http://localhost:8086/query' --data-urlencode "db=testdb" --data-urlencode "q=select * from students limit 1"

  2、使用時間戳(不會進行時區(qū)轉(zhuǎn)換)

  curl -G 'http://localhost:8086/query' --data-urlencode "epoch=ms" --data-urlencode "db=testdb" --data-urlencode "q=select * from students limit 1"

?

好,就這些了,希望對你有幫助。

本文github地址:

https://github.com/mike-zhang/mikeBlogEssays/blob/master/2017/20170311_使用curl操作InfluxDB.md

歡迎補充?

總結(jié)

以上是生活随笔為你收集整理的使用curl操作InfluxDB的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。