From fb5d9f2684bddc4ab83396b6dfdccd4868caf6dc Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Fri, 18 Jan 2019 12:25:15 -0700 Subject: [PATCH] updates to common tasks docs --- content/v2.0/process-data/common-tasks/_index.md | 8 ++++++++ .../v2.0/process-data/common-tasks/downsample-data.md | 11 +++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/content/v2.0/process-data/common-tasks/_index.md b/content/v2.0/process-data/common-tasks/_index.md index 22922804e..465eac997 100644 --- a/content/v2.0/process-data/common-tasks/_index.md +++ b/content/v2.0/process-data/common-tasks/_index.md @@ -10,3 +10,11 @@ menu: --- The following articles walk through common task use cases. + +{{% note %}} +This list will continue to grow. +If you have suggestions, please [create an issue](https://github.com/influxdata/docs-v2/issues/new) +on the InfluxData documentation repository on Github. +{{% /note %}} + +[Downsample Data with InfluxDB](/v2.0/process-data/common-tasks/downsample-data) diff --git a/content/v2.0/process-data/common-tasks/downsample-data.md b/content/v2.0/process-data/common-tasks/downsample-data.md index 0a5149684..56a320893 100644 --- a/content/v2.0/process-data/common-tasks/downsample-data.md +++ b/content/v2.0/process-data/common-tasks/downsample-data.md @@ -1,5 +1,5 @@ --- -title: Downsample data +title: Downsample data with InfluxDB seotitle: Downsample data in an InfluxDB task description: placeholder menu: @@ -9,9 +9,12 @@ menu: weight: 4 --- +- Talk about Continuous Queries + **Requirements:** -- Data source +- A "source" bucket +- A "destination" bucket - Some type of aggregation - and a `to` statement @@ -30,8 +33,8 @@ data = from(bucket: "telegraf") |> range(start: -task.every * 2) |> filter(fn: (r) => r._measurement == "cpu") -downsampleHourly = (table=<-) => - table +downsampleHourly = (tables=<-) => + tables |> aggregateWindow(fn: mean, every: 1h) |> set(key: "_measurement", value: "cpu_1h" ) |> to(bucket: "telegraf_downsampled", org: "my-org")