日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

使用curl操作InfluxDB

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

這里列舉幾個(gè)簡(jiǎn)單的示例代碼,更多信息請(qǐng)參考InfluxDB官方文檔:?https://docs.influxdata.com/influxdb/v1.1/

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

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

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

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

  1、不帶時(shí)間戳  

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

  2、帶時(shí)間戳

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

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

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

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

  2、使用時(shí)間戳(不會(huì)進(jìn)行時(shí)區(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"

?

好,就這些了,希望對(duì)你有幫助。

本文github地址:

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

歡迎補(bǔ)充?

總結(jié)

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

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