updates to common tasks docs

pull/20/head
Scott Anderson 2019-01-18 12:25:15 -07:00
parent 34cc68eac2
commit fb5d9f2684
2 changed files with 15 additions and 4 deletions

View File

@ -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)

View File

@ -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")