Documentation

使用 influx query 命令

使用 influx query 命令,使用 Flux 在 InfluxDB 中查询数据。将 Flux 查询作为文件或通过 stdin 传递给命令。

从文件运行查询
influx query --file /path/to/query.flux
通过 stdin 管道传递原始 Flux
influx query - # Return to open the pipe

data = from(bucket: "example-bucket") |> range(start: -10m) # ...
# Linux & macOS: <ctrl-d> to close the pipe and submit the command
# Windows: <enter>, then <ctrl-d>, then <enter> to close the pipe and submit the command

移除大型数据集中的不必要列

当使用 influx query 命令查询和下载大型数据集时,删除诸如 _start_stop 之类的列以优化下载文件大小。

// ...
    |> drop(columns: ["_start", "_stop"])

此页面是否对您有帮助?

感谢您的反馈!


Flux 的未来

Flux 即将进入维护模式。您可以继续像现在这样使用它,而无需对您的代码进行任何更改。

阅读更多

现已全面上市

InfluxDB 3 Core 和 Enterprise

快速启动。更快扩展。

获取更新

InfluxDB 3 Core 是一个开源、高速、近实时数据引擎,可实时收集和处理数据,并将其持久化到本地磁盘或对象存储。InfluxDB 3 Enterprise 构建在 Core 的基础上,增加了高可用性、读取副本、增强的安全性以及数据压缩功能,从而实现更快的查询和优化的存储。InfluxDB 3 Enterprise 的免费层级可供非商业家庭或业余爱好者使用。

有关更多信息,请查看