sample.data() function
The sample.data()
function downloads and outputs an InfluxDB sample dataset.
import "influxdata/influxdb/sample"
sample.data(set: "airSensor")
Network bandwidth
Each execution of sample.data()
downloads the specified dataset from Amazon S3.
If using InfluxDB Cloud or a hosted InfluxDB OSS instance,
you may see additional network bandwidth costs when using this function.
Approximate sample dataset sizes are listed below
and in the output of sample.list()
.
Parameters
set
(Required) InfluxDB sample dataset to download and output.
Valid values:
Available InfluxDB sample datasets
airSensor
Simulated office building air sensor data with temperature, humidity, and carbon monoxide metrics.
Size: ~600 KB • Updated: every 15m
birdMigration
2019 African bird migration data from the Movebank: Animal Tracking dataset. Contains geotemporal data between 2019-01-01 and 2019-12-31.
Size: ~1.2 MB • Updated: N/A
bitcoin
Bitcoin price data from the last 30 days (Powered by CoinDesk). Data is updated approximately every 15m.
Size: ~700 KB • Updated: every 15m
machineProduction
States and metrics reported from four automated grinding wheel stations on a production line. Contains data from 2021-08-01T00:00:00Z to 2021-08-01T23:59:59Z.
Size: ~11.9 MB • Updated: N/A
noaa
Latest observations from the NOAA National Data Buoy Center (NDBC). Contains only the most recent observations (no historical data). Data is updated approximately every 15m.
Size: ~1.3 MB • Updated: every 15m
noaaWater
Water level observations from two stations reported by the NOAA Center for Operational Oceanographic Products and Services. Contains data between 2019-08-17 and 2019-09-17.
Size: ~10.3 MB • Updated: N/A
usgs
USGS earthquake data from the last week. Contains geotemporal data collected from USGS seismic sensors around the world. Data is updated approximately every 15m.
Size: ~6 MB • Updated: every 15m
Examples
Return USGS earthquake data from the last week
import "influxdata/influxdb/sample"
sample.data(set: "usgs")
Download and write NOAA NDBC data to InfluxDB
Add the following as an InfluxDB task to regularly collect the latest reported observations from the NOAA NDBC.
import "influxdata/influxdb/sample"
option task = {
name: "Collect NOAA NDBC data"
every: 15m,
}
sample.data(set: "noaa")
|> to(
org: "example-org",
bucket: "example-bucket"
)
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.