显示有关最后值缓存的信息
使用 influxdb3 show system table 命令 从 last_caches 系统表中查询并输出 Last Value Cache 信息。
influxdb3 show system \
--database DATABASE_NAME \
--token AUTH_TOKEN \
table last_caches这将返回一个类似以下的表
| table | name | key_column_ids | key_column_names | value_column_ids | value_column_names | count | ttl |
|---|---|---|---|---|---|---|---|
| weather | weather_last | [0] | [location] | [2, 3, 4, 5, 1] | [precip, temp_avg, temp_max, temp_min, wind_avg] | 1 | 86400 |
| bitcoin | bitcoin_last | [0, 1] | [code, crypto] | [4] | [price] | 1 | 14400 |
| numbers | numbers_last | [] | [] | [0, 1] | [a, b] | 5 | 14400 |
| home | home_last | [0] | [room] | [1, 2, 3] | [temp, hum, co] | 5 | 60 |
查询 last_caches 系统表的特定列
使用 --select 选项从 last_caches 系统表中查询特定列。提供一个逗号分隔的列列表以返回
influxdb3 show system \
--database DATABASE_NAME \
--token AUTH_TOKEN \
table last_caches \
--select name,key_column_names,value_column_names对 last_caches 系统表的输出进行排序
使用 --order-by 选项按特定列对 last_caches 系统表的数据进行排序。提供一个逗号分隔的列列表以进行排序
influxdb3 show system \
--database DATABASE_NAME \
--token AUTH_TOKEN \
table last_caches \
--order-by table,ttl结果将根据提供的列按升序排序。
在上面的示例中,请替换以下内容
DATABASE_NAME: 要从中查询系统数据的数据库名称AUTH_TOKEN: 您的 InfluxDB 3 Core 认证令牌
使用 HTTP API
要使用 HTTP API 查询和输出系统表中的缓存信息,请向 /api/v3/query_sql 端点发送 GET 或 POST 请求。
GET /api/v3/query_sql
POST /api/v3/query_sql
查询所有 last value caches
curl -X POST "https://:8181/api/v3/query_sql" \
--header "Authorization: Bearer AUTH_TOKEN" \
--json '{
"db": "DATABASE_NAME",
"q": "SELECT * FROM system.last_caches",
"format": "json"
}'查询特定的缓存详细信息
curl -X POST "https://:8181/api/v3/query_sql" \
--header "Authorization: Bearer AUTH_TOKEN" \
--json '{
"db": "DATABASE_NAME",
"q": "SELECT * FROM system.last_caches WHERE name = '\''CACHE_NAME'\''",
"format": "json"
}'此页面是否有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一员!我们欢迎并鼓励您对 InfluxDB 3 Core 和本文档提供反馈和错误报告。要获得支持,请使用以下资源
具有年度合同或支持合同的客户可以 联系 InfluxData 支持。