This topic provides the sample data that you can download and explains how to import data to a database. This helps you obtain detailed information about the InfluxQL query language. The sample data is referenced in “Data exploration”, “Schema exploration”, and “InfluxQL functions” topics.
Log on to the Alibaba Cloud Management Console and create a database named
In the command-line interface (CLI), run the following command to download a text file that contains data in the line protocol format:
curl https://gist.githubusercontent.com/Maihj/5ee8f25aa025671be49e56a1329db38e/raw/4132e06b4b149db692107387250bdaebf10643e5/NOAA_data.txt -o NOAA_data.txt
In the CLI, run the following command to write the downloaded data to TSDB for InfluxDB®:
influx -ssl -username <Username> -password <Password> -host <Domain name> -port 3242 -import -path=NOAA_data.txt -precision=s -database=NOAA_water_database
$ influx -ssl -username <Username> -password <Password> -host <Domain name> -port 3242 -precision rfc3339 -database NOAA_water_database
Connected to https://<Domain name>:3242 version 1.7.x
InfluxDB shell 1.7.x
View all the measurements in the sample data. The sample data consists of five measurements.
> SHOW measurements
Calculate the number of non-
null field values for the
water_level field key in the
> SELECT COUNT("water_level") FROM h2o_feet
Query the first five reported values in the
> SELECT * FROM h2o_feet LIMIT 5
time level description location water_level
2015-08-18T00:00:00Z below 3 feet santa_monica 2.064
2015-08-18T00:00:00Z between 6 and 9 feet coyote_creek 8.12
2015-08-18T00:06:00Z between 6 and 9 feet coyote_creek 8.005
2015-08-18T00:06:00Z below 3 feet santa_monica 2.116
2015-08-18T00:12:00Z between 6 and 9 feet coyote_creek 7.887
The sample data is published by the Center for Operational Oceanographic Products and Services (CO-OPS) of National Oceanic and Atmospheric Administration (NOAA). The sample data includes 15,258 reported values for water levels (ft). The values are collected at the Santa Monica (ID 9410840) and Coyote Creek, California (ID 9414575) sites over the period from August 18, 2015 to September 18, 2015. The values were updated every 6 seconds.
Note that the
h2o_temperature measurements contain simulated data. The simulated data is used to explain the queries in the “Schema exploration” topic.
InfluxDB® is a trademark registered by InfluxData, which is not affiliated with, and does not endorse, TSDB for InfluxDB®.