From 0e77a2122a623a7bf0ed5faa768ec1091e1c1afe Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sat, 21 Dec 2024 16:30:20 +0100 Subject: [PATCH] InfluxDB: Educate about loading ILP data --- docs/integrate/influxdb/index.md | 43 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/docs/integrate/influxdb/index.md b/docs/integrate/influxdb/index.md index 2aa7097..30fd2b8 100644 --- a/docs/integrate/influxdb/index.md +++ b/docs/integrate/influxdb/index.md @@ -3,27 +3,38 @@ (import-influxdb)= # Import data from InfluxDB -In this quick tutorial, you'll use the [CrateDB Toolkit InfluxDB I/O subsystem] -to import data from [InfluxDB] into [CrateDB]. - -:::{note} -**Important:** The tutorial uses adapter software which is currently in beta testing. -If you discover any issues, please [report them] back to us. -::: +In this quick tutorial, you will use the [CrateDB Toolkit InfluxDB I/O subsystem] +to import data from [InfluxDB] into [CrateDB]. You can also import data directly +from files in InfluxDB line protocol format. ## Synopsis + +### InfluxDB Server Transfer data from InfluxDB bucket/measurement into CrateDB schema/table. -:::{code} shell +```shell ctk load table \ "influxdb2://example:token@influxdb.example.org:8086/testdrive/demo" \ --cratedb-sqlalchemy-url="crate://user:password@cratedb.example.org:4200/testdrive/demo" -::: +``` +Query data in CrateDB. +```shell +export CRATEPW=password +crash --host=cratedb.example.org --username=user --command='SELECT * FROM testdrive.demo;' +``` +### InfluxDB Line Protocol +Transfer data from InfluxDB line protocol file into CrateDB schema/table. +```shell +ctk load table \ + "https://github.com/influxdata/influxdb2-sample-data/raw/master/air-sensor-data/air-sensor-data.lp" \ + --cratedb-sqlalchemy-url="crate://user:password@cratedb.example.org:4200/testdrive/air-sensor-data" +``` Query data in CrateDB. -:::{code} shell +```shell export CRATEPW=password -crash --host=cratedb.example.org --username=user --command="SELECT * FROM testdrive.demo;" -::: +crash --host=cratedb.example.org --username=user --command='SELECT * FROM testdrive."air-sensor-data";' +``` + ## Data Model @@ -37,9 +48,6 @@ data in schemas and tables. - A **field** is similar to an un-indexed column in an SQL database. - A **point** is similar to an SQL row. --- [What are series and bucket in InfluxDB] - - ## Tutorial The tutorial heavily uses Docker to provide services and to run jobs. @@ -164,6 +172,11 @@ The InfluxDB I/O subsystem is based on the [influxio] package. Please also check its documentation to learn about more of its capabilities, supporting you when working with InfluxDB. +:::{note} +**Important:** If you discover any issues with this adapter, please +[report them] back to us. +::: + [cloud platform]: https://docs.influxdata.com/influxdb/cloud/admin [CrateDB]: https://github.com/crate/crate