Sample data
TSDB for InfluxDB® includes a NOAA ocean water-level dataset that you can load in minutes. The dataset is used throughout the Schema exploration, Data exploration, and InfluxQL functions topics to demonstrate real queries against time-series data. If you want to ingest your own data instead, see the data ingestion documentation.
Prerequisites
Before you begin, ensure that you have:
A running TSDB for InfluxDB® instance
The network address, account name, and password for your instance
curland theinfluxCLI installed on your machine
Create a database
On the Alibaba Cloud platform, create a database named NOAA_water_database.
Download and import the sample data
The NOAA dataset is a text file in line protocol format, covering water levels recorded every six seconds from August 18 to September 18, 2015.
Download the data file:
curl https://gist.githubusercontent.com/Maihj/5ee8f25aa025671be49e56a1329db38e/raw/4132e06b4b149db692107387250bdaebf10643e5/NOAA_data.txt -o NOAA_data.txtImport the file into TSDB for InfluxDB®:
influx -ssl -username <Account name> -password <Password> -host <Network address> -port 3242 -import -path=NOAA_data.txt -precision=s -database=NOAA_water_databaseKey parameters:
Parameter Description -sslConnects over TLS. Required for TSDB for InfluxDB®. -hostThe network address of your instance, found in the Alibaba Cloud console. -port 3242The default port for TSDB for InfluxDB®. -precision=sInterprets timestamps in the source file as seconds. -databaseThe target database to import into.
Verify the import
Connect to your instance using the TSDB for InfluxDB® CLI:
$ influx -ssl -username <Account name> -password <Password> -host <Network address> -port 3242 -precision rfc3339 -database NOAA_water_database
Connected to https://<Network address>:3242 version 1.7.x
InfluxDB shell 1.7.x
>Run the following queries to confirm the data loaded correctly.
List all measurements — five should appear:
> SHOW measurements
name: measurements
------------------
name
average_temperature
h2o_feet
h2o_pH
h2o_quality
h2o_temperatureCount non-null values in the water_level field:
> SELECT COUNT("water_level") FROM h2o_feet
name: h2o_feet
--------------
time count
1970-01-01T00:00:00Z 15258Inspect the first five data points:
> SELECT * FROM h2o_feet LIMIT 5
name: h2o_feet
--------------
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.887About the dataset
The h2o_feet measurement contains real data released by the National Oceanic and Atmospheric Administration (NOAA) Center for Operational Oceanographic Products and Services. It covers 15,258 water level observations collected every six seconds at two stations in California:
| Station | ID |
|---|---|
| Santa Monica | 9410840 |
| Coyote Creek | 9414575 |
Water levels are measured in feet.
The remaining four measurements — average_temperature, h2o_pH, h2o_quality, and h2o_temperature — contain fictional data used to illustrate the query feature described in the Schema exploration topic.
InfluxDB® is a trademark registered by InfluxData, which is not affiliated with, and does not endorse, TSDB for InfluxDB®.