这里列举几个简单的示例代码,更多信息请参考InfluxDB官方文档: https://docs.influxdata.com/influxdb/v1.1/

环境: CentOS6.5_x64
InfluxDB版本:1.1.0

  • 创建数据库

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

  • 写入数据

  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'

  • 查询数据

  1、使用时间字符串(会进行时区转换)

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

  2、使用时间戳(不会进行时区转换)

  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

欢迎补充

使用curl操作InfluxDB的更多相关文章

  1. 使用curl操作openstack swift

    openstack官网有专门的开发者文档介绍如何使用curl操作swift(http://docs.openstack.org/api/openstack-object-storage/1.0/con ...

  2. 使用python操作InfluxDB

    环境: CentOS6.5_x64InfluxDB版本:1.1.0Python版本 : 2.6 准备工作 启动服务器 执行如下命令: service influxdb start 示例如下: [roo ...

  3. Python 使用Python远程连接并操作InfluxDB数据库

    使用Python远程连接并操作InfluxDB数据库 by:授客 QQ:1033553122 实践环境 Python 3.4.0 CentOS 6 64位(内核版本2.6.32-642.el6.x86 ...

  4. 使用C语言操作InfluxDB

    环境: CentOS6.5_x64 InfluxDB版本:1.1.0 InfluxDB官网暂未提供C语言开发库,但github提供的有: https://github.com/influxdata/i ...

  5. 使用influx控制台工具操作InfluxDB

    这里记录下influx控制台的简单使用,如需更多功能请参考InfluxDB官方文档: https://docs.influxdata.com/influxdb/v1.1/ 环境: CentOS6.5_ ...

  6. ElasticSearch之CURL操作(有空再去整理)

    https://www.cnblogs.com/jing1617/p/8060421.html ElasticSearch之CURL操作 CURL的操作    curl是利用URL语法在命令行方式下工 ...

  7. 在windows+nginx的curl操作请求超时的问题

    之前的项目在apache下进行本地curl操作的时候请求不会超时 后来要在nginx下开发的时候,我在项目中写一个curl操作的test.php文件,请求相同项目下的一个index.php文件,然后c ...

  8. Go操作influxDB

      influxDB 安装 下载 https://portal.influxdata.com/downloads/ 这里需要注意因为这个网站引用了google的api所以国内点页面的按钮是没反应的,怎 ...

  9. GO学习-(28) Go语言操作influxDB

    Go语言操作influxDB 本文介绍了influxDB时序数据库及Go语言操作influxDB. InfluxDB是一个开源分布式时序.事件和指标数据库.使用Go语言编写,无需外部依赖.其设计目标是 ...

随机推荐

  1. TForm类

    显示给用户的窗体有两种:有模式和无模式的.具体使用哪一种窗体,取决于是否希望用户能够同时与这个窗体和其他窗体交互. 1.当打开一个模式窗体后,用户无法与应用程序的其他部分交互,知道用户关闭了这个窗体. ...

  2. 超棒的30款JS类库和工具

    http://www.csdn.net/article/2013-07-01/2816068-best-javascript-libraries-and-tools

  3. 简单加解密算法 - vb.net

    Public Class Form1    Dim charAarray() As Char    '加密    Private Sub Btn_En_Click(sender As System.O ...

  4. LoadRunner相关架构图

    LoadRunner概览图: Lr架构图:

  5. Web前端常用快捷键总结(OS X系统)

    OS X系统截图:command + shift + 4 强制关闭OS X系统内无响应的程序:command + option +ESC Sublime Text 3: 显示或隐藏Side Bar:c ...

  6. CodeForces 722B

    B. Verse Pattern time limit per test:1 second memory limit per test:256 megabytes input:standard inp ...

  7. windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help

    windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help 在windows8操作系统上安装 ...

  8. 理解volatile

    *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...

  9. Visual Studio 与 Matlab实现混合编程

    环境: Win10 vs2010 Matlab2015 里面有很多选做的内容,其中2.3必做 1.Matlab环境设置:   (选做)我没有做这步,因为打mbuild -setup指令不识别,缺少SD ...

  10. java集合框架02——Collection架构与源码分析

    Collection是一个接口,它主要的两个分支是List和Set.如下图所示: List和Set都是接口,它们继承与Collection.List是有序的队列,可以用重复的元素:而Set是数学概念中 ...