Influxdb客户端使用

1. 简介

Influxdb在网络上可以搜索到一个叫InfluxdbStudio的工具,但只能在window下使用,有时在其他系统下做简单数据查询时就比较麻烦,下面以Influxdb V1.8.0版本为例介绍一下其他的方法。

2. 使用influxdb-client工具

influxdb-client是官方的客户端命令行工具,使用起来也比较舒服,现在使用的版本是InfluxDB shell version: 1.8.6

influx -host 1.0.0.5 -port 8086 -username admin -password admin -precision rfc3339
Connected to http://1.0.0.5:8086 version 1.8.0
InfluxDB shell version: 1.8.6
> help
Usage:
connect <host:port> connects to another node specified by host:port
auth prompts for username and password
pretty toggles pretty print for the json format
chunked turns on chunked responses from server
chunk size <size> sets the size of the chunked responses. Set to 0 to reset to the default chunked size
use <db_name> sets current database
format <format> specifies the format of the server responses: json, csv, or column
precision <format> specifies the format of the timestamp: rfc3339, h, m, s, ms, u or ns
consistency <level> sets write consistency level: any, one, quorum, or all
history displays command history
settings outputs the current settings for the shell
clear clears settings such as database or retention policy. run 'clear' for help
exit/quit/ctrl+d quits the influx shell show databases show database names
show series show series information
show measurements show measurement information
show tag keys show tag key information
show field keys show field key information A full list of influxql commands can be found at:
https://docs.influxdata.com/influxdb/latest/query_language/spec/
> use ssdata;
Using database ssdata
> select x,y,z from data02 limit 10;
name: data02
time x y z
---- - - -
2022-09-15T02:02:53Z 123.4562365413 41.7171729195 56.104
2022-09-15T02:02:53.005Z 123.4562365513 41.7171728794 56.102
2022-09-15T02:02:53.01Z 123.4562365313 41.7171729595 56.106
2022-09-15T02:02:53.015Z 123.4562365114 41.7171730295 56.111
2022-09-15T02:02:53.02Z 123.4562365014 41.7171731096 56.116
2022-09-15T02:02:53.025Z 123.4562364815 41.7171731896 56.12
2022-09-15T02:02:53.03Z 123.4562364615 41.7171732697 56.125
2022-09-15T02:02:53.035Z 123.4562364516 41.7171733497 56.129
2022-09-15T02:02:53.04Z 123.4562364316 41.7171734298 56.134
2022-09-15T02:02:53.045Z 123.4562364117 41.7171735098 56.138 `默认是rfc3339的时间格式,修改格式 ` > precision ms
> select x,y,z from data02 limit 10;
name: data02
time x y z
---- - - -
1663207373000 123.4562365413 41.7171729195 56.104
1663207373005 123.4562365513 41.7171728794 56.102
1663207373010 123.4562365313 41.7171729595 56.106
1663207373015 123.4562365114 41.7171730295 56.111
1663207373020 123.4562365014 41.7171731096 56.116
1663207373025 123.4562364815 41.7171731896 56.12
1663207373030 123.4562364615 41.7171732697 56.125
1663207373035 123.4562364516 41.7171733497 56.129
1663207373040 123.4562364316 41.7171734298 56.134
1663207373045 123.4562364117 41.7171735098 56.138

3. 使用浏览器工具

在浏览器内直接输入:
http://1.0.0.5:8086/query?db=ssdata&u=admin&p=admin&epoch=ms&q=select * from data_cpt02 limit 10 支持的查询参数有:https://docs.influxdata.com/influxdb/v2.4/reference/api/influxdb-1x/query/ Query string parameters
u
(Optional) The 1.x username to authenticate the request. See query string authentication. p
(Optional) The 1.x password to authenticate the request. See query string authentication. db
(Required) The database to query data from. This is mapped to an InfluxDB bucket. See Database and retention policy mapping. rp
The retention policy to query data from. This is mapped to an InfluxDB bucket. See Database and retention policy mapping. q
(Required) The InfluxQL query to execute. To execute multiple queries, delimit queries with a semicolon (;). epoch
Return results with Unix timestamps (also known as epoch timestamps) in the specified precision instead of RFC3339 timestamps with nanosecond precision. The following precisions are available: ns - nanoseconds
u or µ - microseconds
ms - milliseconds
s - seconds
m - minutes
h - hours

Influxdb客户端使用的更多相关文章

  1. .Net版InfluxDB客户端使用时的一些坑

    1.如果应用程序是WebAPi,则需要使用同步版的InfluDB客户端 2.如果应用程序是Winform或Console程序或Windows服务,则使用同步或异步版客户端都可以,建议用异步版 3.如果 ...

  2. 【InfluxDB】InfluxDB学习实践笔记

    InfluxDB是用Go编写的一个开源分布式时序.事件和指标数据库,无需外部依赖.它与Elasticsearch.Graphite等类似.比较适用于与事件紧密相关的数据,例如实时日志数据.实时监控数据 ...

  3. 从源码编译InfluxDB

    操作系统 : CentOS7.3.1611_x64 go语言版本:1.8.3 linux/amd64 InfluxDB版本:1.1.0 go语言安装参考: http://www.cnblogs.com ...

  4. 使用C语言操作InfluxDB

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

  5. Kafka使用jmxtrans+influxdb+grafana监控JMX指标

    最近在搞Kafka集群监控,之前也是看了网上的很多资料.之所以使用jmxtrans+influxdb+grafana是因为界面酷炫,可以定制化,缺点是不能操作Kafka集群,可能需要配合Kafka M ...

  6. ASP.NET Core2读写InfluxDB时序数据库

    在我们很多应用中会遇到有一种基于一系列时间的数据需要处理,通过时间的顺序可以将这些数据点连成线,再通过数据统计后可以做成多纬度的报表,也可通过机器学习来实现数据的预测告警.而时序数据库就是用于存放管理 ...

  7. sentinel控制台监控数据持久化【InfluxDB】

    根据官方wiki文档,sentinel控制台的实时监控数据,默认仅存储 5 分钟以内的数据.如需持久化,需要定制实现相关接口. https://github.com/alibaba/Sentinel/ ...

  8. InfluxDB的安装和简介

    InfluxDB简介 InfluxDB是一个时间序列数据库,旨在处理高写入和查询负载.它是TICK堆栈的组成部分 .InfluxDB旨在用作涉及大量带时间戳数据的任何用例的后备存储,包括DevOps监 ...

  9. influxdb的命令们

    InfluxDB是一个开源的时序数据库,使用GO语言开发,特别适合用于处理和分析资源监控数据这种时序相关数据.而InfluxDB自带的各种特殊函数如求标准差,随机取样数据,统计数据变化比等,使数据统计 ...

  10. influxdb+Grafana+jmeter监控搭建

    安装InfluxDB InfluxDB的简介 InfluxDB 是用Go语言编写的一个开源分布式时序.事件和指标数据库,无需外部依赖. 类似的数据库有Elasticsearch.Graphite等.. ...

随机推荐

  1. mac os黑苹果安装

    前言 习惯了mac敲代码的攻城师很难再去适应windows,那么如何在windows上安装苹果系统呢?用黑苹果. 关于黑苹果的安装,网上的一大堆教程显得过于啰嗦,又是安装Unlocker破解mac限制 ...

  2. JZOJ 3571. 【GDKOI2014】内存分配

    解析 也就是说建一棵权值线段树维护这些信息.要注意的是每次的最优解必然是 \(b\) 小的先做,故离线排序确定离散后的下标再依次求解 \(Code\) #include<cstdio> # ...

  3. python破解zip或者rar压缩文件

    转载博客园python大师:https://www.cnblogs.com/daniumiqi/p/12167764.html

  4. 系统提权之:Unix 提权

    郑重声明: 本笔记编写目的只用于安全知识提升,并与更多人共享安全知识,切勿使用笔记中的技术进行违法活动,利用笔记中的技术造成的后果与作者本人无关.倡导维护网络安全人人有责,共同维护网络文明和谐. 系统 ...

  5. 自己动手从零写桌面操作系统GrapeOS系列教程——6.电脑启动过程介绍

    学习操作系统原理最好的方法是自己写一个简单的操作系统. 按一下电脑上的电源按钮,电脑就启动了,不一会儿电脑屏幕上就出现了登录界面或直接进入了桌面. 这是一个很日常的场景,但有时候会有个疑问:电脑内部是 ...

  6. OpenAI Chat completion API 入门指南

    Chat completion API 入门指南 ChatGPT 由 OpenAI 最先进的语言模型 gpt-3.5-turbo 提供支持. 使用 OpenAI API,您可以使用 GPT-3.5-t ...

  7. CF1137F Matches Are Not a Child's Play 题解

    以最后被删去的点为根,这样子不会存在从父亲然后删掉某个点,儿子的删除顺序一定比父亲前. 记每个点子树中的最大值为 \(f_x\),那么一个点的排名,首先就需要加上 \(<f_x\) 的所有值,记 ...

  8. Vue框架中有关 computed的相关知识

    1,传统使用computed属性的方式如下: 注意:此时如果我们点击修改的时候会有如下警告(表示computed属性不可以修改,如果非得修改,我们应该如下下图所示操作) 2,修改computed属性的 ...

  9. C语言中static关键字用法

    概述 static关键字在c语言中比较常用,使用恰当能够大大提高程序的模块化特性,有利于扩展和维护. 在程序中使用static 变量 1. 局部变量 普通局部变量是再熟悉不过的变量了,在任何一个函数内 ...

  10. 蓝牙mesh组网实战(智能家居应用)

    目录 蓝牙mesh组网目前存在有入门门槛高的问题,比如,嵌入式工程师需要考虑到标准mesh模型的兼容,app开发工程师需要了解mesh协议栈才能直接走mesh与芯片通信.而沁恒官方提供的透传模型简洁易 ...