示例数据
在InfluxDB Cloud Serverless文档中使用示例数据集来展示功能。
使用以下示例数据集来复制提供的示例。
开始获取家庭传感器数据
包含每小时的家庭传感器数据,用于 开始使用 InfluxDB Cloud Serverless 指南。 此数据集包括异常传感器读数,并有助于展示 处理和警报时间序列数据。 要自定义数据集中的时间戳,请使用页面右下角的 按钮。 这使您可以修改样本数据集,以保持在 您写入的存储桶的保留期内。
时间范围
2022-01-01T08:00:00Z 到 2022-01-01T20:00:00Z (可定制)
模式
- 首页 (测量)
- 标签:
- 房间
- 厨房
- 客厅
- 房间
- 字段:
- co (整数)
- temp (浮点数)
- hum (浮点数)
- 标签:
将家庭传感器数据写入InfluxDB
将家庭传感器数据写入InfluxDB
使用 InfluxDB v2 或 v1 API 将入门家庭传感器示例数据写入 InfluxDB Cloud Serverless。
curl --request POST \
https://cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME&precision=s \
--header "Authorization: Bearer API_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://cloud2.influxdata.com/write?db=BUCKET_NAME&precision=s \
--header "Authorization: Bearer API_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
"
在示例脚本中替换以下内容:
BUCKET_NAME: 您的 InfluxDB Cloud Serverless 存储桶API_TOKEN: 一个 API token,具有对桶的 写入 权限
家庭传感器动作数据
包括由开始使用家庭传感器数据中的数据触发的假设行为,并且是该示例数据集的配套数据集。要自定义数据集中的时间戳,请使用页面右下角的按钮。这使您可以修改示例数据集,以保持在您写入的数据库的保留期内。
时间范围
2022-01-01T08:00:00Z 到 2022-01-01T20:00:00Z (可定制)
模式
- home_actions (measurement)
- 标签:
- 房间
- 厨房
- 客厅
- 动作
- 警报
- 冷却
- 级别
- 正常
- 警告
- 房间
- 字段:
- 描述 (字符串)
- 标签:
将家庭传感器动作数据写入InfluxDB
将家庭传感器动作数据写入InfluxDB
使用 InfluxDB v2 或 v1 API 将家庭传感器操作示例数据写入 InfluxDB Cloud Serverless。
curl --request POST \
https://cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME&precision=s \
--header "Authorization: Bearer API_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://cloud2.influxdata.com/write?db=BUCKET_NAME&precision=s \
--header "Authorization: Bearer API_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
'
在示例脚本中替换以下内容:
BUCKET_NAME: 您的 InfluxDB Cloud Serverless 存储桶API_TOKEN: 一个 数据库令牌 具有 写入 数据库的权限
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 Cloud Serverless。
curl --request POST \
https://cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "$(curl --request GET https://docs.influxdata.com/downloads/bay-area-weather.lp)"
curl --request POST \
https://cloud2.influxdata.com/write?db=BUCKET_NAME \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdata.com/downloads/bay-area-weather.lp)"
在示例脚本中替换以下内容:
BUCKET_NAME: 您的 InfluxDB Cloud Serverless 桶API_TOKEN: 一个API token,具有足够的 对存储桶的权限
比特币价格数据
比特币价格样本数据集提供了从 2023-05-01T00:00:00Z到2023-05-15T00:00:00Z 的比特币价格——由CoinDesk提供。
时间范围
2023-05-01T00:19:00Z 到 2023-05-14T23:48:00Z
模式
- 比特币 (测量)
- 标签:
- 代码
- 欧元
- 英镑
- 美元
- 加密货币
- 比特币
- 描述
- 欧元
- 英镑
- 美国美元
- 符号
- € (€)
- £ (£)
- $ ($)
- 代码
- 字段
- 价格 (浮点)
- 标签:
将比特币示例数据写入InfluxDB
将比特币价格示例数据写入InfluxDB
使用 InfluxDB v2 或 v1 API 将比特币价格样本数据写入 InfluxDB Cloud Serverless。
curl --request POST \
https://cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "$(curl --request GET https://docs.influxdata.com/downloads/bitcoin.lp)"
curl --request POST \
https://cloud2.influxdata.com/write?db=BUCKET_NAME \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdata.com/downloads/bitcoin.lp)"
在示例脚本中替换以下内容:
BUCKET_NAME: 您的 InfluxDB Cloud 无服务器存储桶API_TOKEN: 一个 API token,具有足够的权限访问桶
随机数样本数据
包含两个每分钟报告一次随机生成数字的字段。 每个字段都有特定范围的随机生成数字。 这个示例数据集用于演示数学运算和转换函数。
时间范围
2023-01-01T00:00:00Z 到 2023-01-01T12:00:00Z
模式
- 数字 (测量)
- 字段
- a (浮动在 -1 和 1 之间)
- b (浮动在 -3 和 3 之间)
- 字段
将随机数字样本数据写入InfluxDB
将随机数样本数据写入InfluxDB
使用 InfluxDB v2 或 v1 API 将随机数字样本数据写入 InfluxDB Cloud Serverless。
curl --request POST \
https://cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-Type: text/plain; charset=utf-8" \
--header "Accept: application/json" \
--data-binary "$(curl --request GET https://docs.influxdata.com/downloads/random-numbers.lp)"
curl --request POST \
https://cloud2.influxdata.com/write?db=BUCKET_NAME \
--header "Authorization: Bearer API_TOKEN" \
--header "Content-type: text/plain; charset=utf-8" \
--data-binary "$(curl --request GET https://docs.influxdata.com/downloads/random-numbers.lp)"
在示例脚本中替换以下内容:
BUCKET_NAME: 您的 InfluxDB Cloud Serverless 存储桶API_TOKEN: 一个API token,具有对存储桶的足够权限