示例数据
InfluxDB 3 Core 处于公开 Alpha 阶段
InfluxDB 3 Core 处于公开 alpha 阶段,可用于测试和反馈,但**不适用于生产环境**。产品和本文档都在不断完善中。我们欢迎并鼓励您提供关于 alpha 体验的意见,并邀请您**加入我们的公共频道**以获取更新和分享反馈。
Alpha 阶段的预期和建议
- 在 alpha 阶段,我们可能会进行重大更改,这可能需要您删除数据并重新开始。如果您使用的数据很重要,请在其他地方保留备份副本。
- 在 alpha 阶段,我们会在每次合并到 InfluxDB
main
分支时生成新的构建版本。更改频繁,相关更新会发布到我们的公共频道。
InfluxDB 3 Core 文档通篇使用示例数据集来演示功能。使用以下示例数据集来重现提供的示例。
家庭传感器数据
包含模拟的每小时家庭传感器数据,其中包含异常传感器读数,以演示时间序列数据的处理和警报。要自定义数据集中的时间戳,请使用页面右下角的 按钮。
时间范围
2022-01-01T08:00:00Z 至 2022-01-01T20:00:00Z (可自定义)
模式
- home (表)
- 标签:
- 房间
- 厨房
- 客厅
- 房间
- 字段:
- co (整数)
- temp (浮点数)
- hum (浮点数)
- 标签:
将家庭传感器数据写入 InfluxDB
将家庭传感器数据写入 InfluxDB
使用 influxdb3 CLI、InfluxDB v2 API 或 InfluxDB v1 API 将家庭传感器示例数据写入 InfluxDB 3 Core。
influxdb3 write \
--token AUTH_TOKEN \
--database DATABASE_NAME \
'home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000
home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600
home,room=Kitchen temp=23.0,hum=36.2,co=0i 1641027600
home,room=Living\ Room temp=21.8,hum=36.0,co=0i 1641031200
home,room=Kitchen temp=22.7,hum=36.1,co=0i 1641031200
home,room=Living\ Room temp=22.2,hum=36.0,co=0i 1641034800
home,room=Kitchen temp=22.4,hum=36.0,co=0i 1641034800
home,room=Living\ Room temp=22.2,hum=35.9,co=0i 1641038400
home,room=Kitchen temp=22.5,hum=36.0,co=0i 1641038400
home,room=Living\ Room temp=22.4,hum=36.0,co=0i 1641042000
home,room=Kitchen temp=22.8,hum=36.5,co=1i 1641042000
home,room=Living\ Room temp=22.3,hum=36.1,co=0i 1641045600
home,room=Kitchen temp=22.8,hum=36.3,co=1i 1641045600
home,room=Living\ Room temp=22.3,hum=36.1,co=1i 1641049200
home,room=Kitchen temp=22.7,hum=36.2,co=3i 1641049200
home,room=Living\ Room temp=22.4,hum=36.0,co=4i 1641052800
home,room=Kitchen temp=22.4,hum=36.0,co=7i 1641052800
home,room=Living\ Room temp=22.6,hum=35.9,co=5i 1641056400
home,room=Kitchen temp=22.7,hum=36.0,co=9i 1641056400
home,room=Living\ Room temp=22.8,hum=36.2,co=9i 1641060000
home,room=Kitchen temp=23.3,hum=36.9,co=18i 1641060000
home,room=Living\ Room temp=22.5,hum=36.3,co=14i 1641063600
home,room=Kitchen temp=23.1,hum=36.6,co=22i 1641063600
home,room=Living\ Room temp=22.2,hum=36.4,co=17i 1641067200
home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200'
curl --request POST \
https://#:8181/api/v2/write?bucket=DATABASE_NAME&precision=s \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "
home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000
home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600
home,room=Kitchen temp=23.0,hum=36.2,co=0i 1641027600
home,room=Living\ Room temp=21.8,hum=36.0,co=0i 1641031200
home,room=Kitchen temp=22.7,hum=36.1,co=0i 1641031200
home,room=Living\ Room temp=22.2,hum=36.0,co=0i 1641034800
home,room=Kitchen temp=22.4,hum=36.0,co=0i 1641034800
home,room=Living\ Room temp=22.2,hum=35.9,co=0i 1641038400
home,room=Kitchen temp=22.5,hum=36.0,co=0i 1641038400
home,room=Living\ Room temp=22.4,hum=36.0,co=0i 1641042000
home,room=Kitchen temp=22.8,hum=36.5,co=1i 1641042000
home,room=Living\ Room temp=22.3,hum=36.1,co=0i 1641045600
home,room=Kitchen temp=22.8,hum=36.3,co=1i 1641045600
home,room=Living\ Room temp=22.3,hum=36.1,co=1i 1641049200
home,room=Kitchen temp=22.7,hum=36.2,co=3i 1641049200
home,room=Living\ Room temp=22.4,hum=36.0,co=4i 1641052800
home,room=Kitchen temp=22.4,hum=36.0,co=7i 1641052800
home,room=Living\ Room temp=22.6,hum=35.9,co=5i 1641056400
home,room=Kitchen temp=22.7,hum=36.0,co=9i 1641056400
home,room=Living\ Room temp=22.8,hum=36.2,co=9i 1641060000
home,room=Kitchen temp=23.3,hum=36.9,co=18i 1641060000
home,room=Living\ Room temp=22.5,hum=36.3,co=14i 1641063600
home,room=Kitchen temp=23.1,hum=36.6,co=22i 1641063600
home,room=Living\ Room temp=22.2,hum=36.4,co=17i 1641067200
home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
"
curl --request POST \
https://#:8181/write?db=DATABASE_NAME&precision=s \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "
home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000
home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000
home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600
home,room=Kitchen temp=23.0,hum=36.2,co=0i 1641027600
home,room=Living\ Room temp=21.8,hum=36.0,co=0i 1641031200
home,room=Kitchen temp=22.7,hum=36.1,co=0i 1641031200
home,room=Living\ Room temp=22.2,hum=36.0,co=0i 1641034800
home,room=Kitchen temp=22.4,hum=36.0,co=0i 1641034800
home,room=Living\ Room temp=22.2,hum=35.9,co=0i 1641038400
home,room=Kitchen temp=22.5,hum=36.0,co=0i 1641038400
home,room=Living\ Room temp=22.4,hum=36.0,co=0i 1641042000
home,room=Kitchen temp=22.8,hum=36.5,co=1i 1641042000
home,room=Living\ Room temp=22.3,hum=36.1,co=0i 1641045600
home,room=Kitchen temp=22.8,hum=36.3,co=1i 1641045600
home,room=Living\ Room temp=22.3,hum=36.1,co=1i 1641049200
home,room=Kitchen temp=22.7,hum=36.2,co=3i 1641049200
home,room=Living\ Room temp=22.4,hum=36.0,co=4i 1641052800
home,room=Kitchen temp=22.4,hum=36.0,co=7i 1641052800
home,room=Living\ Room temp=22.6,hum=35.9,co=5i 1641056400
home,room=Kitchen temp=22.7,hum=36.0,co=9i 1641056400
home,room=Living\ Room temp=22.8,hum=36.2,co=9i 1641060000
home,room=Kitchen temp=23.3,hum=36.9,co=18i 1641060000
home,room=Living\ Room temp=22.5,hum=36.3,co=14i 1641063600
home,room=Kitchen temp=23.1,hum=36.6,co=22i 1641063600
home,room=Living\ Room temp=22.2,hum=36.4,co=17i 1641067200
home,room=Kitchen temp=22.7,hum=36.5,co=26i 1641067200
"
在示例脚本中替换以下内容
DATABASE_NAME
:要写入的数据库名称AUTH_TOKEN
:您的 InfluxDB 3 Core 授权令牌在 alpha 阶段,InfluxDB 3 Core 不需要授权令牌。您可以省略 CLI
--token
选项或 HTTPAuthorization
标头,也可以提供任意令牌字符串。
家庭传感器动作数据
包含由开始入门家庭传感器数据中的数据触发的假设动作,并且是该示例数据集的配套数据集。要自定义数据集中的时间戳,请使用页面右下角的 按钮。 这使您可以修改示例数据集,使其保持在您写入数据库的保留期内。
时间范围
2022-01-01T08:00:00Z 至 2022-01-01T20:00:00Z (可自定义)
模式
- home_actions (表)
- 标签:
- 房间
- 厨房
- 客厅
- 动作
- 警报
- 凉爽
- 级别
- 正常
- 警告
- 房间
- 字段:
- description (字符串)
- 标签:
将家庭传感器动作数据写入 InfluxDB
将家庭传感器动作数据写入 InfluxDB
使用 influxdb3 CLI、InfluxDB v2 API 或 InfluxDB v1 API 将家庭传感器动作示例数据写入 InfluxDB 3 Core。
influxdb3 write \
--token AUTH_TOKEN \
--database DATABASE_NAME \
'home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23°C). Cooling to 22°C." 1641027600
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.3°C). Cooling to 22°C." 1641060000
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.1°C). Cooling to 22°C." 1641063600
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 18 ppm." 1641060000
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 22 ppm." 1641063600
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 26 ppm." 1641067200
home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 14 ppm." 1641063600
home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 17 ppm." 1641067200'
curl --request POST \
https://#:8181/api/v2/write?bucket=DATABASE_NAME&precision=s \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary '
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23°C). Cooling to 22°C." 1641027600
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.3°C). Cooling to 22°C." 1641060000
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.1°C). Cooling to 22°C." 1641063600
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 18 ppm." 1641060000
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 22 ppm." 1641063600
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 26 ppm." 1641067200
home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 14 ppm." 1641063600
home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 17 ppm." 1641067200
'
curl --request POST \
https://#:8181/write?db=DATABASE_NAME&precision=s \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary '
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23°C). Cooling to 22°C." 1641027600
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.3°C). Cooling to 22°C." 1641060000
home_actions,room=Kitchen,action=cool,level=ok description="Temperature at or above 23°C (23.1°C). Cooling to 22°C." 1641063600
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 18 ppm." 1641060000
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 22 ppm." 1641063600
home_actions,room=Kitchen,action=alert,level=warn description="Carbon monoxide level above normal: 26 ppm." 1641067200
home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 14 ppm." 1641063600
home_actions,room=Living\ Room,action=alert,level=warn description="Carbon monoxide level above normal: 17 ppm." 1641067200
'
在示例脚本中替换以下内容
DATABASE_NAME
:要写入的数据库名称AUTH_TOKEN
:您的 InfluxDB 3 Core 授权令牌在 alpha 阶段,InfluxDB 3 Core 不需要授权令牌。您可以省略 CLI
--token
选项或 HTTPAuthorization
标头,也可以提供任意令牌字符串。
NOAA 旧金山湾区天气数据
包含 2020 年 1 月 1 日至 2022 年 12 月 31 日期间,来自旧金山湾区三个机场的每日天气指标。此示例数据集包含季节性趋势,非常适合探索涉及季节性的时间序列用例。
时间范围
2020-01-01T00:00:00Z 至 2022-12-31T00:00:00Z
模式
- weather (表)
- 标签:
- 位置
- 康科德
- 海沃德
- 旧金山
- 位置
- 字段
- precip (浮点数)
- temp_avg (浮点数)
- temp_max (浮点数)
- temp_min (浮点数)
- wind_avg (浮点数)
- 标签:
将 NOAA 旧金山湾区天气数据写入 InfluxDB
将 NOAA 旧金山湾区天气数据写入 InfluxDB
使用 influxdb3 CLI、InfluxDB v2 API 或 InfluxDB v1 API 将 NOAA 旧金山湾区天气示例数据写入 InfluxDB 3 Core。
influxdb3 write \
--token AUTH_TOKEN \
--database DATABASE_NAME \
"$(curl --request GET https://docs.influxdb.org.cn/downloads/bay-area-weather.lp)"
curl --request POST \
https://#:8181/api/v2/write?bucket=DATABASE_NAME \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/bay-area-weather.lp)"
curl --request POST \
https://#:8181/write?db=DATABASE_NAME \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/bay-area-weather.lp)"
在示例脚本中替换以下内容
DATABASE_NAME
:要写入的数据库名称AUTH_TOKEN
:您的 InfluxDB 3 Core 授权令牌在 alpha 阶段,InfluxDB 3 Core 不需要授权令牌。您可以省略 CLI
--token
选项或 HTTPAuthorization
标头,也可以提供任意令牌字符串。
比特币价格数据
比特币价格示例数据集提供 2023-05-01T00:00:00Z 至 2023-05-15T00:00:00Z 的比特币价格—数据来源 CoinDesk。
时间范围
2023-05-01T00:19:00Z 至 2023-05-14T23:48:00Z
模式
- bitcoin (表)
- 标签:
- 代码
- EUR
- GBP
- USD
- 加密货币
- 比特币
- 描述
- 欧元
- 英镑
- 美元
- 符号
- € (€)
- £ (£)
- $ ($)
- 代码
- 字段
- price (浮点数)
- 标签:
将比特币示例数据写入 InfluxDB
将比特币价格示例数据写入 InfluxDB
使用 influxdb3 CLI、InfluxDB v2 API 或 InfluxDB v1 API 将比特币价格示例数据写入 InfluxDB 3 Core。
influxdb3 write \
--token AUTH_TOKEN \
--database DATABASE_NAME \
"$(curl --request GET https://docs.influxdb.org.cn/downloads/bitcoin.lp)"
curl --request POST \
https://#:8181/write?db=DATABASE_NAME \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/bitcoin.lp)"
在示例脚本中替换以下内容
DATABASE_NAME
:要写入的数据库名称AUTH_TOKEN
:您的 InfluxDB 3 Core 授权令牌在 alpha 阶段,InfluxDB 3 Core 不需要授权令牌。您可以省略 CLI
--token
选项或 HTTPAuthorization
标头,也可以提供任意令牌字符串。
随机数示例数据
包含每分钟报告的两个具有随机生成数字的字段。每个字段都有特定范围的随机生成数字。此示例数据集用于演示数学运算和转换函数。
时间范围
2023-01-01T00:00:00Z 至 2023-01-01T12:00:00Z
模式
- numbers (表)
- 字段
- a (介于 -1 和 1 之间的浮点数)
- b (介于 -3 和 3 之间的浮点数)
- 字段
将随机数示例数据写入 InfluxDB
将随机数示例数据写入 InfluxDB
使用 influxdb3 CLI、InfluxDB v2 API 或 InfluxDB v1 API 将随机数示例数据写入 InfluxDB 3 Core。
influxdb3 write \
--token AUTH_TOKEN \
--database DATABASE_NAME \
"$(curl --request GET https://docs.influxdb.org.cn/downloads/random-numbers.lp)"
curl --request POST \
https://#:8181/api/v2/write?bucket=DATABASE_NAME \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/random-numbers.lp)"
curl --request POST \
https://#:8181/write?db=DATABASE_NAME \
--header "Authorization: Bearer AUTH_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/random-numbers.lp)"
在示例脚本中替换以下内容
DATABASE_NAME
:要写入的数据库名称AUTH_TOKEN
:您的 InfluxDB 3 Core 授权令牌在 alpha 阶段,InfluxDB 3 Core 不需要授权令牌。您可以省略 CLI
--token
选项或 HTTPAuthorization
标头,也可以提供任意令牌字符串。
此页面是否对您有帮助?
感谢您的反馈!
支持和反馈
感谢您成为我们社区的一份子!我们欢迎并鼓励您提供关于 InfluxDB 3 Core 和本文档的反馈和错误报告。要获得支持,请使用以下资源
签有年度合同或支持合同的客户可以联系 InfluxData 支持。