# Continous Query Influxdb without aggregate functions possible?

**URL:** <https://community.influxdata.com/t/continous-query-influxdb-without-aggregate-functions-possible/3221>\
**Category:** Systems\
**Tags:** influxdb\
**Created:** [November 27, 2017, 9:36pm UTC](https://community.influxdata.com/t/continous-query-influxdb-without-aggregate-functions-possible/3221 "2017-11-27T21:36:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AdityaHandadi](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@AdityaHandadi](https://community.influxdata.com/u/AdityaHandadi)\
**Post date:** [November 27, 2017, 9:36pm UTC](https://community.influxdata.com/t/continous-query-influxdb-without-aggregate-functions-possible/3221/1 "2017-11-27T21:36:05Z")

</div>

Can I create a continuous query without using aggregate functions? I have been following the influxdb documentation and I don’t see if you can use it without any functions like MIN(), MAX(), MEAN() etc.

What if I wanted something like this:

CREATE CONTINUOUS QUERY minnie ON world BEGIN SELECT mouse,location INTO min\_mouse FROM zoo GROUP BY time(30m) END  
Is that possible to replicate the metrics into a new measurement? Because ultimately that is what I would want, and I thought continous query was the solution.

---

<div class="post-metadata">

**Author:** ![katy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/katy/32/855_2.png) [@katy](https://community.influxdata.com/u/katy)\
**Post date:** [December 4, 2017, 7:56pm UTC](https://community.influxdata.com/t/continous-query-influxdb-without-aggregate-functions-possible/3221/2 "2017-12-04T19:56:31Z")

</div>

Continuous queries must have an aggregate function. However, a good alternate would be to use Kapacitor.

If you use a TICKscript like this:

```auto
stream
    |from()
        .measurement('my_old_measurement')
    |influxDBOut()
        .measurement('my_new_measurement')
        .database('db_name')

```

You can pipe your old measurement into a new measurement.

If you want to read about getting started with Kapacitor, take a look at these [docs](http://docs.influxdata.com/kapacitor/v1.3/introduction/getting_started/).

---

<div class="post-metadata">

**Author:** ![alvianno](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/alvianno/32/2780_2.png) [@alvianno](https://community.influxdata.com/u/alvianno)\
**Post date:** [August 7, 2018, 9:05am UTC](https://community.influxdata.com/t/continous-query-influxdb-without-aggregate-functions-possible/3221/3 "2018-08-07T09:05:53Z")

</div>

how to if other server influxdb

---

<div class="post-metadata">

**Author:** ![noahcrowley](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/noahcrowley/32/818_2.png) [@noahcrowley](https://community.influxdata.com/u/noahcrowley)\
**Post date:** [August 7, 2018, 12:51pm UTC](https://community.influxdata.com/t/continous-query-influxdb-without-aggregate-functions-possible/3221/4 "2018-08-07T12:51:15Z")

</div>

You will need to configure a second InfluxDB connection in the [Kapacitor config](https://docs.influxdata.com/kapacitor/v1.5/administration/configuration/#the-kapacitor-configuration-file) (see the InfluxDB sub-section and the [example config on GitHub](https://github.com/influxdata/kapacitor/blob/master/etc/kapacitor/kapacitor.conf)).

Each InfluxDB connection has a name in the configuration, for example, `influx2`:

```plaintext
# Multiple InfluxDB configurations can be defined.
# Exactly one must be marked as the default.
# Each one will be given a name and can be referenced in batch queries and InfluxDBOut nodes.
[[influxdb]]
  # Connect to an InfluxDB cluster
  # Kapacitor can subscribe, query and write to this cluster.
  # Using InfluxDB is not required and can be disabled.
  enabled = true
  default = true
  name = "influx2"
  urls = ["http://localhost:8086"]

...

```

You can specify which InfluxDB instance to send data to using the [.cluster()](https://docs.influxdata.com/kapacitor/v1.5/nodes/influx_d_b_out_node/#cluster) property method of the [InfluxDBOut node](https://docs.influxdata.com/kapacitor/v1.5/nodes/influx_d_b_out_node/), which takes the name of your database as defined in the configuration as a string argument. For example, if I wanted to send data to the database `influx2`:

```plaintext
stream
    |from()
        .measurement('my_old_measurement')
    |influxDBOut()
        .measurement('my_new_measurement')
        .cluster('influx2')
        .database('db_name')

```
