当前位置:网站首页>Datakit acts as an API server for local data acquisition
Datakit acts as an API server for local data acquisition
2022-06-29 21:44:00 【InfoQ】
summary
precondition
Interactive model data query “DQL Inquire about ”
datakit --dql # perhaps datakit -Q
dql > cpu limit 1
-----------------[1.cpu ]-----------------
cpu 'cpu-total'
host'tan-air.local'
time2022-01-13 16:06:03 +0800 CST
usage_irq 0
usage_idle 56.928839
usage_nice 0
usage_user 19.825218
usage_guest 0
usage_steal 0
usage_total 43.071161
usage_iowait 0
usage_system 23.245943
usage_softirq 0
usage_guest_nice 0
---------
1 rows, cost 13.55119msSingle execution DQL Inquire about
# Execute one query statement at a time
datakit --run-dql 'cpu limit 1'
# Write the execution result to CSV file
datakit --run-dql 'O::HOST:(os, message)' --csv="path/to/your.csv"
# Force overwrite existing CSV file
datakit --run-dql 'O::HOST:(os, message)' --csv /path/to/xxx.csv --force
# Write results to CSV At the same time , Query results are also displayed on the terminal
datakit --run-dql 'O::HOST:(os, message)' --csv="path/to/your.csv" --vvvname,active,available,available_percent,free,host,time
mem,2016870400,2079637504,24.210166931152344,80498688,achen.local,1635242524385
mem,2007961600,2032476160,23.661136627197266,30900224,achen.local,1635242534385
mem,2014437376,2077097984,24.18060302734375,73502720,achen.local,1635242544382DQL Query results JSON turn
datakit --run-dql 'O::HOST:(os, message)' --json
datakit -Q --json
# If the field value is JSON character string , Then do it automatically JSON beautify ( Be careful :JSON In mode ( namely --json),`--auto-json` Invalid option )
datakit --run-dql 'O::HOST:(os, message)' --auto-json
-----------------[ r1.HOST.s1 ]-----------------
message ----- json ----- # JSON There are obvious signs at the beginning , here message For field name
{
"host":{
"meta":{
"host_name":"www",
.... # Long text is omitted here
"config":{
"ip":"10.100.64.120",
"enable_dca": false,
"http_listen":"localhost:9529",
"api_token":"tkn_f2b9920f05d84d6bb5b14d9d39db1dd3"
}
}
----- end of json ----- # JSON There are obvious signs at the end
os 'darwin'
time2022-01-13 16:56:22 +0800 CST
---------
8 rows, 1 series, cost 4msQuerying data for a specific workspace
datakit --run-dql 'O::HOST:(os, message)' --token <your-token>
datakit -Q --token <your-token>DataKit API
边栏推荐
- 数字密码锁verilog设计+仿真+上板验证
- A. Beat The Odds
- Goahead webserver migration
- Goahead translation - Active Server Pages
- C. Most Similar Words
- varnish 503 no backend connection – varnish健康检查
- API interfaces for all products in Alibaba stores (item_search_shop- obtain all product interfaces in the store), Alibaba API interfaces
- Varnish 503 no backend connection – varnish health check
- 不同系统下的文件层级符号小结
- STL tutorial 6-deque, stack, queue, list container
猜你喜欢

Small library project summary

Report delivery engineer

Matlab adds noise / disturbance to data

Hardware development notes (VIII): basic process of hardware development, making a USB to RS232 module (VII): creating a basic dip component (crystal oscillator) package and associating the principle

Autodesk Revit 2023 software installation package download and installation tutorial

每周招聘|DBA数据工程师,年薪35+ ,梦起九州,星河灿烂!

Summary of document level symbols under different systems

Gstreamer应用开发实战指南(五)

Layer 3 loop brought by route Summary - solution experiment

STM32 and gd32 notes
随机推荐
API interfaces for all products in Alibaba stores (item_search_shop- obtain all product interfaces in the store), Alibaba API interfaces
C. Most Similar Words
shell 实现Memcache缓存命中率监控脚本
阿里巴巴商品详情API接口(item_get-获得商品详情接口),阿里巴巴API接口
What is a SYN Flood attack? How to protect?
阿里巴巴关键字搜索商品API接口(item_search-按关键字搜索商品接口),阿里巴巴搜索API接口
Rsync method of establishing multi directory module
唯品会关键词搜索API接口(item_search-按关键字搜索唯品会商品API接口),唯品会API接口
ads131a04 ADC verilog实现及仿真
How to integrate MES system with ERP? This article tells you the answer
How to judge the quality of conductive slip ring from its appearance
Varnish 503 no backend connection – varnish health check
Layer 3 loop brought by route Summary - solution experiment
leetcode:724. Find the central subscript of the array
Top ten questions for senior Performance Test Engineer
数字密码锁verilog设计+仿真+上板验证
leetcode:370. Interval addition
推荐书籍--白夜行
【ROS进阶篇】第四讲 ROS中的重名问题(节点、话题与参数)
leetcode:238. 除自身以外数组的乘积