示例数据
示例数据集贯穿InfluxDB Clustered文档,以展示功能。使用以下示例数据集来复制提供的示例。
入门级家庭传感器数据
包括在入门InfluxDB Clustered指南中使用的每小时家庭传感器数据。此数据集包括异常传感器读数,有助于展示时间序列数据处理和警报。要自定义数据集中的时间戳,请使用页面右下角的按钮。这可以使您修改示例数据集,以保持在您写入的数据库的保留期内。
时间范围
2022-01-01T08:00:00Z 至 2022-01-01T20:00:00Z (可定制)
模式
- home (度量)
- 标签:
- room
- 厨房
- 客厅
- room
- 字段:
- co (整数)
- temp (浮点数)
- hum (浮点数)
- 标签:
将家庭传感器数据写入InfluxDB
将家庭传感器数据写入InfluxDB
使用InfluxDB v2或v1 API将入门级家庭传感器样本数据写入InfluxDB Clustered。
curl --request POST \
https://cluster-host.com/api/v2/write?bucket=DATABASE_NAME&precision=s \
--header "Authorization: Bearer DATABASE_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://cluster-host.com/write?db=DATABASE_NAME&precision=s \
--header "Authorization: Bearer DATABASE_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
"
替换以下示例脚本中的内容
家庭传感器动作数据
包括由入门级家庭传感器数据中的数据触发的假设动作,是该样本数据集的配套数据集。要自定义数据集中的时间戳,请使用页面右下角的按钮。这可以使您修改示例数据集,以保持在您写入的数据库的保留期内。
时间范围
2022-01-01T08:00:00Z 至 2022-01-01T20:00:00Z (可定制)
模式
- home_actions (度量)
- 标签:
- room
- 厨房
- 客厅
- action
- alert
- cool
- level
- ok
- warn
- room
- 字段:
- description (字符串)
- 标签:
将家庭传感器动作数据写入InfluxDB
将家庭传感器动作数据写入InfluxDB
使用InfluxDB v2或v1 API将家庭传感器动作样本数据写入InfluxDB Clustered。
curl --request POST \
https://cluster-host.com/api/v2/write?bucket=DATABASE_NAME&precision=s \
--header "Authorization: Bearer DATABASE_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://cluster-host.com/write?db=DATABASE_NAME&precision=s \
--header "Authorization: Bearer DATABASE_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
'
替换以下示例脚本中的内容
NOAA湾区天气数据
包含来自旧金山湾区三个机场的每日天气指标,时间范围从 2020年1月1日至2022年12月31日。该样本数据集包括季节性趋势,适用于探索涉及季节性的时间序列用例。
时间范围
2020-01-01T00:00:00Z 至 2022-12-31T00:00:00Z
模式
- 天气 (测量)
- 标签:
- 位置
- 康科德
- 海沃德
- 旧金山
- 位置
- 字段
- 降水 (浮点数)
- 平均温度 (浮点数)
- 最高温度 (浮点数)
- 最低温度 (浮点数)
- 平均风速 (浮点数)
- 标签:
将NOAA湾区天气数据写入InfluxDB
将NOAA湾区天气数据写入InfluxDB
使用InfluxDB v2或v1 API将NOAA湾区天气样本数据写入InfluxDB集群。
curl --request POST \
http://cluster-host.com/api/v2/write?bucket=DATABASE_NAME \
--header "Authorization: Bearer DATABASE_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 \
http://cluster-host.com/write?db=DATABASE_NAME \
--header "Authorization: Bearer DATABASE_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/bay-area-weather.lp)"
替换以下示例脚本中的内容
比特币价格数据
比特币价格样本数据集提供了从 2023-05-01T00:00:00Z 至 2023-05-15T00:00:00Z 的比特币价格——由CoinDesk提供支持。
时间范围
2023-05-01T00:19:00Z 至 2023-05-14T23:48:00Z
模式
- 比特币 (测量)
- 标签:
- 代码
- EUR
- GBP
- USD
- 加密货币
- 比特币
- 描述
- 欧元
- 英镑
- 美元
- 符号
- € (€)
- £ (£)
- $ ($)
- 代码
- 字段
- 价格 (浮点数)
- 标签:
将比特币样本数据写入InfluxDB
将比特币价格样本数据写入InfluxDB
使用InfluxDB v2或v1 API将比特币价格样本数据写入InfluxDB集群。
curl --request POST \
http://cluster-host.com/api/v2/write?bucket=DATABASE_NAME \
--header "Authorization: Bearer DATABASE_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/bitcoin.lp)"
curl --request POST \
http://cluster-host.com/write?db=DATABASE_NAME \
--header "Authorization: Bearer DATABASE_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/bitcoin.lp)"
替换以下示例脚本中的内容
随机数字示例数据
包括两个每分钟报告一次随机数的字段。每个字段都有特定的随机数范围。该样本数据集用于演示数学运算和转换函数。
时间范围
2023-01-01T00:00:00Z 至 2023-01-01T12:00:00Z
模式
- 数字 (测量)
- 字段
- a (-1和1之间的浮点数)
- b (-3和3之间的浮点数)
- 字段
将随机数样本数据写入InfluxDB
将随机数样本数据写入InfluxDB
使用InfluxDB v2或v1 API将随机数样本数据写入InfluxDB集群。
curl --request POST \
http://cluster-host.com/api/v2/write?bucket=DATABASE_NAME \
--header "Authorization: Bearer DATABASE_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 \
http://cluster-host.com/write?db=DATABASE_NAME \
--header "Authorization: Bearer DATABASE_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdb.org.cn/downloads/random-numbers.lp)"
替换以下示例脚本中的内容
这个页面有帮助吗?
感谢您的反馈!