TL;DR InfluxDB Tech Tips - Unwanted Series, Retention Policy, Bind Parameters

Navigate to:

In this post we recap the week’s most interesting InfluxDB and TICK-stack related issues, workarounds, how-tos and Q&A from GitHub, IRC and the InfluxDB Google Group that you might have missed.

Removing series from InfluxDB

Q: I’m seeing a lot about needing to limit my series cardinality in the documentation. Is there a way to remove unwanted series from my database?

A: Yes - you can drop series with DROP DATABASE, DROP MEASUREMENT, and DROP SERIES. All of those commands remove series from the index and reduce your overall series cardinality.

Check out the Database Management page for more detailed documentation.

Writing to a non-DEFAULT retention policy with the CLI

Q: How do I write to a retention policy that’s not the DEFAULT retention policy using InfluxDB’s CLI? The non-DEFAULT retention policy exists but I can’t figure out how to write to it using line protocol.

My retention policies:

name      duration   shardGroupDuration   replicaN   default
autogen   0          168h0m0s             1          true
one_day   24h0m0s    1h0m0s               1          false

A: You can use the syntax INSERT INTO <retention_policy> <line_protocol> to write data to a non-DEFAULT retention policy using the CLI.

For example:

> INSERT INTO one_day mortality bool=true
Using retention policy one_day
> SELECT * FROM "mydb"."one_day"."mortality"
name: mortality
time                             bool
2016-09-13T22:29:43.229530864Z   true

Note that you will need to fully qualify the measurement to query data in the non-DEFAULT retention policy. Fully qualify the measurement with the syntax:


Bind parameters

Q: Does the HTTP API support bind parameters?

A: Yes! The API supports binding parameters to particular field values or tag values in the WHERE clause.

Check out the API reference doc for more on usage and syntax.

For more InfluxDB tips, see our Frequently Asked Questions page and feel free to post your questions in the InfluxDB users group!

What's next?

  • Download and get started with InfluxDB!
  • Schedule a FREE 20 minute consultation with a Solutions Architect to review your InfluxDB project.
  • Attend one of our FREE virtual training seminars.
  • Got a question and need an immediate answer from the InfluxData Support team? Support subscriptions with unlimited incidents start at just $399 a month. Check out all the support options here.