linux下influx客户端使用
2024-10-21 13:38:33
influxdb-client
通过
sudo apt-cache search influx
找到了一个客户端工具
influxdb-client - command line interface for InfluxDB
直接安装
sudo apt install influxdb-client
influx
Connected to http://localhost:8086 version v2.2.0
InfluxDB shell version: 1.6.7~rc0
> 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/
> connect 192.168.0.5:8086
> auth
username: admin
password:
> show databases
name: databases
name
----
mydata
_internal
graphite
> use mydata
Using database mydata
> select time,a0 from data_tt limit 10
name: data_tt
time a0
---- --
0 -0.91
0 -0.91
0 -0.91
0 -1.24
0 -1.24
0 -1.25
0 -1.35
0 -1.35
0 -1.35
0 -1.38
还有一种方法就是在浏览器其直接访问:
http://192.168.0.5:8086/query?db=mydata&q=select a0 from data_tt limit 10
在浏览器内会提示输入用户名称和密码,就可以显示查询到的数据
{"results":[{"statement_id":0,"series":[{"name":"data_tt","columns":["time","a0"],"values":[["1970-01-01T00:00:00Z","-0.91"],["1970-01-01T00:00:00Z","-0.91"],["1970-01-01T00:00:00Z","-0.91"],["1970-01-01T00:00:00Z","-1.24"],["1970-01-01T00:00:00Z","-1.24"],["1970-01-01T00:00:00Z","-1.25"],["1970-01-01T00:00:00Z","-1.35"],["1970-01-01T00:00:00Z","-1.35"],["1970-01-01T00:00:00Z","-1.35"],["1970-01-01T00:00:00Z","-1.38"]]}]}]}
最新文章
- ceph hadoop spark 大数据处理
- 设计模式之单例模式Singleton(三创建型)
- SQL SERVER 2012 从Enterprise Evaluation Edtion 升级到 Standard Edtion SP1
- 除了白名单外的IP每秒最多处理 8 个请求 limit_conn_zone
- Android FM模块学习之四源码学习(2)
- zabbix网络发现
- NoSQL数据库有哪些
- 批处理脚本修改hosts文件指定域名解析IP
- Setting Up the ADT Bundle
- JAVA Timer定时器使用方法(二)
- MyBatis-进阶2
- 【BZOJ4025】二分图
- selenium java maven自动化测试环境搭建
- mysql数据安装问题汇总
- 文本相似度分析(基于jieba和gensim)
- SqlServer代理(已禁用代理xp)
- 解决方案:System.InvalidOperationException: 此实现不是 Windows 平台 FIPS 验证的加密算法的一部分。
- BZOJ 2530 Poi2011 Party 【枚举】
- 解决区间第K大的问题的各种方法
- Loadrunner Analysis之Web Page Diagnostics