TL;DR InfluxDB Tech Tips – October 27, 2016

Regan Kuchan — October 27, 2016

In this weekly post we recap the 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 in the last week or so.

Configure Returned Timestamps

Q: I’m working with InfluxDB’s Command Line Interface and I’d like my timestamps to be returned in second-precision epoch time. Is there a way to do this?

A: InfluxDB’s CLI returns timestamps in nanosecond epoch format by default. You can specify alternative formats with the precision <format> command:

> SELECT * FROM "lukes"
name: lukes
time                  coffee_sales   lorelei
----                  ------------   -------
1477472400000000000   2              false
1477473300000000000   7              true

> precision s                     <--- ⏰ Changes the epoch precision to seconds ⏰ 

> SELECT * FROM "lukes"
name: lukes
time         coffee_sales   lorelei
----         ------------   -------
1477472400   2              false
1477473300   7              true

On a related note, the HTTP API returns timestamps in RFC3339 format by default. Specify alternative formats with the epoch query string parameter.

Backfill Results for Continuous Queries

Q: I created a continuous query (see below) and I noticed it didn’t backfill results for my older data. My data go back to 2015. Is this the expected behavior?

CREATE CONTINUOUS QUERY "clandestine_clementine" ON "oval_orange"
BEGIN
SELECT MEAN("melting_mandarin") INTO "tempestuous_tangerine" FROM "nebulous_navel" GROUP BY time(8m)
END

A: Continuous Queries operate on realtime data. You’ll need to use a basic INTO query to backfill results for older data. Check out Common Issues with Basic Syntax for more Continuous Query gotchas.

Error Documentation

Q: Is there a place where I can find documentation on errors?

A: Yes! We’ve created a new documentation page that details the different error messages and their causes. Check it out! 🍊

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.