<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>InfluxData Blog - Regan Kuchan</title>
    <description>Posts by Regan Kuchan on the InfluxData Blog</description>
    <link>https://www.influxdata.com/blog/author/rkuchan/</link>
    <language>en-us</language>
    <lastBuildDate>Thu, 22 Jun 2017 04:00:11 -0700</lastBuildDate>
    <pubDate>Thu, 22 Jun 2017 04:00:11 -0700</pubDate>
    <ttl>1800</ttl>
    <item>
      <title>TL;DR Tech Tips: New Query Language Features in Version 1.3</title>
      <description>&lt;p&gt;In this post, we give a preview of some new query language features in InfluxQL version 1.3.&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;New Operators&lt;/h2&gt;
&lt;p&gt;Version 1.3 introduces several new mathematical operators:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Modulo (&lt;code&gt;%&lt;/code&gt;)&lt;/li&gt;
 	&lt;li&gt;Bitwise AND (&lt;code&gt;&amp;amp;&lt;/code&gt;)&lt;/li&gt;
 	&lt;li&gt;Bitwise OR (&lt;code&gt;|&lt;/code&gt;)&lt;/li&gt;
 	&lt;li&gt;Bitwise Exclusive-OR (&lt;code&gt;^&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following query calculates the moduli between two fields:  &lt;code&gt;cod&lt;/code&gt; and &lt;code&gt;pod&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT "cod" % "pod" FROM "prod"

name: prod
time                  cod_pod
----                  -------
2017-06-21T22:55:25Z  0
2017-06-21T22:56:25Z  1
2017-06-21T22:57:25Z  3&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;New time zone clause&lt;/h2&gt;
&lt;p&gt;InfluxQL’s new time zone clause returns the UTC offset for the specified timezone. The query below returns the UTC offset for Chicago’s time zone:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT "water_level" FROM "h2o_feet" WHERE "location" = 'santa_monica' AND time &amp;gt;= '2015-08-18T00:00:00Z' AND time &amp;lt;= '2015-08-18T00:18:00Z' tz('America/Chicago')

name: h2o_feet
time                       water_level
----                       -----------
2015-08-17T19:00:00-05:00  2.064
2015-08-17T19:06:00-05:00  2.116
2015-08-17T19:12:00-05:00  2.028
2015-08-17T19:18:00-05:00  2.126&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;New duration unit&lt;/h2&gt;
&lt;p&gt;Duration units specify the time precision in InfluxQL queries and when writing data to InfluxDB. InfluxQL Version 1.3 introduces a new nanosecond duration unit: &lt;code&gt;ns&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The query below uses a &lt;code&gt;GROUP BY time()&lt;/code&gt; clause to group averages into &lt;code&gt;1000000000&lt;/code&gt; nanosecond buckets:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT MEAN("value") FROM "gopher" WHERE time &amp;gt;= 1497481480598711679 AND time &amp;lt;= 1497481484005926368 GROUP BY time(1000000000ns)&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt; for the TICK-stack are live on our "downloads" page.&lt;/li&gt;
 	&lt;li&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;Get started with a FREE trial of &lt;a href="https://www.influxdata.com/get-influxdb/"&gt;InfluxDB Cloud&lt;/a&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/li&gt;
 	&lt;li&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;a href="https://portal.influxdata.com/users/new"&gt;InfluxDB Enterprise&lt;/a&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores.&lt;/li&gt;
 	&lt;li&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://www.influxdata.com/customers/"&gt;Over 300 companies&lt;/a&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 22 Jun 2017 04:00:11 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-tech-tips-new-query-language-features-in-version-1-3/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-tech-tips-new-query-language-features-in-version-1-3/</guid>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR Tech Tips: New InfluxQL Functions in Version 1.3</title>
      <description>&lt;p&gt;In this post, we give a preview of the new InfluxQL functions in version 1.3. Check in next week for the most interesting TICK Stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;a href="https://github.com/influxdata/influxdb/issues"&gt;GitHub&lt;/a&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;Community.&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;New Function: INTEGRAL()&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;INTEGRAL()&lt;/code&gt; function returns the area under the curve for subsequent field values. The query below returns the area under the curve (in seconds) for the field values associated with the &lt;code&gt;water_level&lt;/code&gt; field key and in the &lt;code&gt;h2o_feet&lt;/code&gt; measurement:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT INTEGRAL("water_level") FROM "h2o_feet" WHERE "location" = 'santa_monica' AND time &amp;gt;= '2015-08-18T00:00:00Z' AND time &amp;lt;= '2015-08-18T00:30:00Z'

name: h2o_feet
time                  integral
----                  --------
1970-01-01T00:00:00Z  3732.66&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;New Function: NON_NEGATIVE_DIFFERENCE()&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;NON_NEGATIVE_DIFFERENCE()&lt;/code&gt; function returns the non-negative result of subtraction between subsequent field values. Non-negative results of subtraction include positive differences and differences that equal zero. The query below returns the non-negative difference between subsequent field values in the &lt;code&gt;water_level&lt;/code&gt; field key and in the &lt;code&gt;h2o_feet&lt;/code&gt; measurement:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT NON_NEGATIVE_DIFFERENCE("water_level") FROM "h2o_feet" WHERE time &amp;gt;= '2015-08-18T00:00:00Z' AND time &amp;lt;= '2015-08-18T00:30:00Z' AND "location" = 'santa_monica'

name: h2o_feet
time                  non_negative_difference
----                  -----------------------
2015-08-18T00:06:00Z  0.052000000000000046
2015-08-18T00:18:00Z  0.09799999999999986
2015-08-18T00:30:00Z  0.010000000000000231&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Updated Functions: TOP() and BOTTOM()&lt;/h2&gt;
&lt;p&gt;Version 1.3 introduces three major changes to the &lt;code&gt;TOP()&lt;/code&gt; and &lt;code&gt;BOTTOM&lt;/code&gt; functions:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code&gt;TOP()&lt;/code&gt; and &lt;code&gt;BOTTOM()&lt;/code&gt; no longer support other functions in the &lt;code&gt;SELECT&lt;/code&gt; clause. The following query returns an error:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT TOP(value,1),MEAN(value) FROM "gopher"
  
ERR: error parsing query: selector function top() cannot be combined with other functions&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code&gt;TOP()&lt;/code&gt; and &lt;code&gt;BOTTOM()&lt;/code&gt; now maintain tags as tags if the query includes a tag key as an argument. The query below preserves &lt;code&gt;location&lt;/code&gt; as a tag in the newly-written data:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT BOTTOM("water_level","location",2) INTO "bottom_water_levels" FROM "h2o_feet"

name: result
time                 written
----                 -------
1970-01-01T00:00:00Z 2

&amp;gt; SHOW TAG KEYS FROM "bottom_water_levels"

name: bottom_water_levels
tagKey
------
location&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;code&gt;TOP()&lt;/code&gt; and &lt;code&gt;BOTTOM()&lt;/code&gt; now preserve the timestamps in the original data when they're used with the &lt;code&gt;GROUP BY time()&lt;/code&gt; clause. The following query returns the points' original timestamps; the timestamps are not forced to match the start of the &lt;code&gt;GROUP BY time()&lt;/code&gt; intervals:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT TOP("water_level",2) FROM "h2o_feet" WHERE time &amp;gt;= '2015-08-18T00:00:00Z' AND time &amp;lt;= '2015-08-18T00:30:00Z' AND "location" = 'santa_monica' GROUP BY time(18m)

name: h2o_feet
time                   top
----                   ------
                           __
2015-08-18T00:00:00Z  2.064 |
2015-08-18T00:06:00Z  2.116 | &amp;lt;------- Greatest points for the first time interval
                           --
                           __
2015-08-18T00:18:00Z  2.126 |
2015-08-18T00:30:00Z  2.051 | &amp;lt;------- Greatest points for the second time interval
                           --&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt; for the TICK Stack are live on our "downloads" page.&lt;/li&gt;
 	&lt;li&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;Get started with a FREE trial of &lt;a href="https://cloud.influxdata.com/"&gt;InfluxDB Cloud&lt;/a&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/li&gt;
 	&lt;li&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;a href="https://portal.influxdata.com/"&gt;InfluxDB Enterprise&lt;/a&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores.&lt;/li&gt;
 	&lt;li&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;Over 300 companies&lt;/a&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 15 Jun 2017 04:00:54 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-tech-tips-functions-version-1-3/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-tech-tips-functions-version-1-3/</guid>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR Tech Tips: Managing the Work History in Chronograf</title>
      <description>&lt;p&gt;&lt;span style="font-weight: 400;"&gt;In this post, we recap some new material that you might have missed in the past week or so. Check in next week for the most interesting TICK-stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;/span&gt;&lt;a href="https://github.com/influxdata/influxdb/issues"&gt;&lt;span style="font-weight: 400;"&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;Community&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Managing alert history in Chronograf&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; I’m using &lt;a href="https://docs.influxdata.com/chronograf/latest/"&gt;Chronograf&lt;/a&gt; to create &lt;a href="https://docs.influxdata.com/chronograf/latest/guides/create-a-kapacitor-alert/"&gt;alert rules&lt;/a&gt; and monitor my infrastructure. My Alert History page shows a lot of alert occurrences; I can narrow down the occurrences with the filter box and the time range selector, but is there a way to expire the occurrences that I no longer need?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;There is! Chronograf stores the information on the Alert History page as time series data in InfluxDB. It stores it in the &lt;code&gt;chronograf&lt;/code&gt; database and in the &lt;code&gt;alerts&lt;/code&gt; &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#measurement"&gt;measurement&lt;/a&gt;. By default, those data are subject to an infinite &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#retention-policy-rp"&gt;retention policy&lt;/a&gt; (RP), that is, InfluxDB stores them forever. To expire your alert history data, just shorten the &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#duration"&gt;duration&lt;/a&gt; of that RP.&lt;/p&gt;

&lt;p&gt;We recommend using Chronograf’s Admin page to modify the retention policy in the &lt;code&gt;chronograf&lt;/code&gt; database. In the Databases tab:&lt;/p&gt;
&lt;h4 id="step-1-locate-the-chronograf-database-and-click-on-the-infinity-symbol"&gt;1: Locate the &lt;code&gt;chronograf&lt;/code&gt; database and click on the infinity symbol (?)&lt;/h4&gt;
&lt;p&gt;&lt;img class="alignnone size-full wp-image-8797" src="/images/legacy-uploads/g-advkap-dur.png" alt="" width="1280" height="428" /&gt;&lt;/p&gt;
&lt;h4 id="step-2-enter-a-different-duration"&gt;2: Enter a different duration&lt;/h4&gt;
&lt;p&gt;The minimum allowable duration is one hour (&lt;code&gt;1h&lt;/code&gt;) and the maximum is infinite (&lt;code&gt;INF&lt;/code&gt;). See the InfluxDB documentation for the list of acceptable &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/spec/#durations"&gt;duration units&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id="step-3-click-the-green-check-mark-to-save-your-changes"&gt;3: Click the green check mark to save your changes&lt;/h4&gt;
&lt;p&gt;That’s it! InfluxDB only keeps data in the &lt;code&gt;chronograf&lt;/code&gt; database that fall within that new duration; the system automatically deletes any data with timestamps that occur before the duration setting.&lt;/p&gt;
&lt;h2&gt;Writing data with Chronograf&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’ve been using the deprecated &lt;a href="https://docs.influxdata.com/influxdb/latest/tools/web_admin/"&gt;web admin interface&lt;/a&gt; to write data to InfluxDB. Is there a way to write data using &lt;a href="https://docs.influxdata.com/chronograf/latest/"&gt;Chronograf&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Starting with version 1.3.2.0, Chronograf’s Data Explorer supports writing data to your InfluxDB databases.&lt;/p&gt;

&lt;p&gt;To write data with Chronograf, click the &lt;code&gt;Write Data&lt;/code&gt; icon at the top of the Data Explorer page and select your target database. Next, enter your &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#line-protocol"&gt;line protocol&lt;/a&gt; in the main text box and click the &lt;code&gt;Write&lt;/code&gt; button.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8782" src="/images/legacy-uploads/write-data-1.png" alt="" width="1976" height="586" /&gt;&lt;/p&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 01 Jun 2017 04:00:13 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-june-01-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-june-01-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR InfluxDB Tech Tips: Identical Field Keys &amp; Tag Keys, Existing Kapacitor TICKscripts in Chronograf &amp; More</title>
      <description>&lt;p&gt;&lt;span style="font-weight: 400;"&gt;In this post, we recap some new material that you might have missed in the past week or so. Check in next week for the most interesting TICK-stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;/span&gt;&lt;a href="https://github.com/influxdata/influxdb/issues"&gt;&lt;span style="font-weight: 400;"&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;Community&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Identical field keys and tag keys&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; My InfluxDB schema consists of the &lt;code&gt;feet-attire&lt;/code&gt; &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#measurement"&gt;measurement&lt;/a&gt;, the &lt;code&gt;shoes&lt;/code&gt; &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#tag"&gt;tag&lt;/a&gt; which tracks shoe color, and the &lt;code&gt;shoes&lt;/code&gt; &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#field"&gt;field&lt;/a&gt; which tracks shoe quantity. When I attempt to query both the &lt;code&gt;shoes&lt;/code&gt; tag and the &lt;code&gt;shoe&lt;/code&gt; field, I see duplicate rows of the &lt;code&gt;shoe&lt;/code&gt; field but nothing for the &lt;code&gt;shoe&lt;/code&gt; tag. Is there a way to see both the field and tag?&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT "shoes","shoes" FROM "feet-attire"

name: feet-attire
time                            shoes shoes_1
----                            ----- -------
2017-05-17T20:34:32.143717027Z  12    12
2017-05-17T20:34:39.949844001Z  15    15
2017-05-17T20:34:47.325195089Z  16    16&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;There is! Use the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-basic-select-statement"&gt;&lt;code&gt;::&lt;/code&gt; syntax&lt;/a&gt; to specify if the &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#identifier"&gt;identifier&lt;/a&gt; is a field or tag:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT "shoes"::field,"shoes"::tag FROM "feet-attire"

name: feet-attire
time                            shoes shoes_1
----                            ----- -------
2017-05-17T20:34:32.143717027Z  12    yellow
2017-05-17T20:34:39.949844001Z  15    blue
2017-05-17T20:34:47.325195089Z  16    pink&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Field keys or tag keys called &lt;code&gt;time&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’m using InfluxDB version 1.2.2 and I can’t seem to query my data. It looks like the write succeeds but my queries don’t return any results. Can you help me out? What am I doing wrong?&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;~# curl -i -XPOST "http://localhost:8086/write?db=tldr&amp;amp;u=&amp;lt;username&amp;gt;&amp;amp;p=&amp;lt;password&amp;gt;" --data-binary 'creatures time="1h"'
HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: b76456c6-3b47-11e7-8f86-000000000000
X-Influxdb-Version: 1.2.1-c1.2.2
Date: Wed, 17 May 2017 21:28:06 GMT

~# curl -G "http://localhost:8086/query?db=tldr&amp;amp;u=&amp;lt;username&amp;gt;&amp;amp;p=&amp;lt;password&amp;gt;" --data-urlencode 'q=SHOW MEASUREMENTS'
{"results":[{"statement_id":0}]}


~# curl -G "http://localhost:8086/query?db=tldr&amp;amp;u=&amp;lt;username&amp;gt;&amp;amp;p=&amp;lt;password&amp;gt;" --data-urlencode 'q=SELECT * FROM creatures'
{"results":[{"statement_id":0}]}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;A:&lt;/b&gt; Your syntax looks good! It’s &lt;code&gt;time&lt;/code&gt; that’s causing the issue.&lt;b&gt; &lt;/b&gt;&lt;code&gt;time&lt;/code&gt; is a special keyword in InfluxDB. &lt;code&gt;time&lt;/code&gt; can be a &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#continuous-query-cq"&gt;continuous query&lt;/a&gt; name, database name, &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#measurement"&gt;measurement&lt;/a&gt; name, &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#retention-policy-rp"&gt;retention policy&lt;/a&gt; name, &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#subscription"&gt;subscription&lt;/a&gt; name, and username. It can’t be a &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#field-key"&gt;field key&lt;/a&gt; or &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#tag-key"&gt;tag key&lt;/a&gt; in InfluxDB.&lt;/p&gt;

&lt;p&gt;In version 1.2.2 (more specifically, versions 1.2.0-1.2.3), InfluxDB accepts writes with &lt;code&gt;time&lt;/code&gt; as a field or tag key but it silently drops the field key or tag key and its associated value. In version 1.2.4, we’ve changed that behavior; InfluxDB rejects writes with &lt;code&gt;time&lt;/code&gt; as a field key or tag key and returns an error. Check out our &lt;a href="https://docs.influxdata.com/influxdb/latest/troubleshooting/frequently-asked-questions/#what-words-and-characters-should-i-avoid-when-writing-data-to-influxdb"&gt;FAQ&lt;/a&gt; page for more information!&lt;/p&gt;
&lt;h2&gt;Existing Kapacitor TICKscripts in Chronograf&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I just started using &lt;a href="https://docs.influxdata.com/chronograf/latest/"&gt;Chronograf&lt;/a&gt; and I have some &lt;a href="https://docs.influxdata.com/kapacitor/latest/"&gt;Kapacitor&lt;/a&gt; tasks that I created prior to using Chronograf. Will those tasks show up on Chronograf’s Alert Rules page?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A:&lt;/b&gt; Currently, Kapacitor tasks that you created outside of Chronograf have limited functionality in the user interface.&lt;/p&gt;

&lt;p&gt;In Chronograf, you can:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;View pre-existing tasks the Alert Rules page&lt;/li&gt;
 	&lt;li&gt;View pre-existing tasks' activity on the Alert History page&lt;/li&gt;
 	&lt;li&gt;Enable and disable pre-existing tasks on the Alert Rules page (this is equivalent to the &lt;code&gt;kapacitor enable&lt;/code&gt; and &lt;code&gt;kapacitor disable &lt;/code&gt;commands)&lt;/li&gt;
 	&lt;li&gt;Delete pre-existing tasks the Alert Rules page (this is equivalent to the &lt;code&gt;kapacitor delete tasks&lt;/code&gt; command)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You cannot edit pre-existing tasks on Chronograf’s Alert Rules page. The &lt;code&gt;mytick&lt;/code&gt; task in the image below is a pre-existing task; its name appears on the Alert Rules page but you cannot click on it or edit its TICKscript in the interface. Currently, you must manually edit your existing tasks and TICKscripts on your machine.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8385" src="/images/legacy-uploads/g-advkap-pretick.png" alt="" width="1280" height="414" /&gt;&lt;/p&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 18 May 2017 04:00:56 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-may-18-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-may-18-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR InfluxDB Tech Tips: Configuring Telegraf &amp; Kapacitor When auth is Enabled on InfluxDB &amp; Tips on Chronograf</title>
      <description>&lt;p&gt;&lt;span style="font-weight: 400;"&gt;In this post, we recap some new material that you might have missed in the past week or so. Check in next week for the most interesting TICK stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;/span&gt;&lt;a href="https://github.com/influxdata/influxdb/issues"&gt;&lt;span style="font-weight: 400;"&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;Community&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Understanding Chronograf's status icon&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; I’m using &lt;a href="https://docs.influxdata.com/chronograf/v1.3/"&gt;Chronograf&lt;/a&gt; to monitor my infrastructure and one of the status icons on the Host List page is red. What does this mean exactly?&lt;/p&gt;

&lt;p&gt;My Host List page:&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8279" src="/images/legacy-uploads/status-icon.png" alt="" width="1280" height="410" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;The status icon on Chronograf’s Host List page is a high-level measure of your hosts’ health. If Chronograf has not received data from a host’s &lt;a href="https://docs.influxdata.com/telegraf/latest/"&gt;Telegraf&lt;/a&gt; instance for the past minute, the status icon turns red. If Chronograf has received data from a host within the past minute, the status icon remains green.&lt;/p&gt;

&lt;p&gt;On your Host List page, it looks like Chronograf hasn’t received Telegraf data from &lt;code&gt;node-abode-02&lt;/code&gt; for at least the past minute.&lt;/p&gt;
&lt;h2&gt;Configuring Telegraf and Kapacitor when authentication is enabled on InfluxDB&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’m trying to connect a &lt;a href="https://docs.influxdata.com/telegraf/latest/"&gt;Telegraf&lt;/a&gt; instance and a &lt;a href="https://docs.influxdata.com/kapacitor/latest/"&gt;Kapacitor&lt;/a&gt; instance to &lt;a href="https://docs.influxdata.com/influxdb/latest/"&gt;InfluxDB&lt;/a&gt;. I’ve &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/authentication_and_authorization/#set-up-authentication"&gt;enabled authentication&lt;/a&gt; on my InfluxDB instance and I get the following errors in the Telegraf and Kapacitor logs when I try to start those processes. How to I specify the authentication credentials in Telegraf and Kapacitor?&lt;/p&gt;

&lt;p&gt;Log errors:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;# Telegraf
InfluxDB Output Error: {"error":"unable to parse authentication credentials"}

# Kapacitor
run: open server: open service *influxdb.Service: failed to link subscription on startup: unable to parse authentication credentials&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Specify your InfluxDB &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/authentication_and_authorization/#user-management-commands"&gt;username and password&lt;/a&gt; in the Telegraf and Kapacitor configuration files. On most systems, Telegraf’s &lt;a href="https://docs.influxdata.com/telegraf/latest/administration/configuration/"&gt;configuration file&lt;/a&gt; is located at &lt;code&gt;/etc/telegraf/telegraf.conf&lt;/code&gt; and Kapacitor’s configuration file is located at /&lt;code&gt;etc/kapacitor/kapacitor.conf&lt;/code&gt;. I’ve printed out the relevant configuration settings below. Once you’ve updated those files, just start the Telegraf and Kapacitor processes and you’re good to go!&lt;/p&gt;

&lt;p&gt;Telegraf configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;[[outputs.influxdb]]
  ## The full HTTP or UDP endpoint URL for your InfluxDB instance.

  [...]

  username = "administer" #????
  password = "supersupersecret" #????&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Kapacitor configuration file:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;[[influxdb]]
  # Connect to an InfluxDB cluster
  # Kapacitor can subscribe, query and write to 

  [...]

  username = "administer" #????
  password = "supersupersecret" #????&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Introducing Chronograf's visualization types&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’m thinking about using &lt;a href="https://docs.influxdata.com/chronograf/v1.3/"&gt;Chronograf&lt;/a&gt; to create a dashboard; what visualization types do you support?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Currently, Chronograf supports five visualization types: line, stacked, step-plot, singleStat, and line+stat.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8287" src="/images/legacy-uploads/viz-types-2.png" alt="" width="1019" height="759" /&gt;&lt;/p&gt;

&lt;p&gt;Check out Chronograf’s &lt;a href="https://docs.influxdata.com/chronograf/v1.3/troubleshooting/frequently-asked-questions/#what-visualization-types-does-chronograf-support"&gt;FAQ page&lt;/a&gt; for more information about our visualization types and the &lt;a href="https://docs.influxdata.com/chronograf/v1.3/guides/create-a-dashboard/"&gt;Create a Dashboard&lt;/a&gt; guide to get started with your customized dashboard!&lt;/p&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 11 May 2017 04:00:18 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-may-11-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-may-11-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR InfluxDB Tech Tips - Template Variables, Query Building, &amp; User Management in Chronograf</title>
      <description>&lt;p&gt;&lt;span style="font-weight: 400;"&gt;In this post, we recap some new material that you might have missed in the past week or so. Check in next week for the most interesting TICK-stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;/span&gt;&lt;a href="https://github.com/influxdata/influxdb/issues"&gt;&lt;span style="font-weight: 400;"&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;Community&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Template variables in Chronograf&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; I have a &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#tag-key"&gt;tag key&lt;/a&gt; with fifteen different &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#tag-value"&gt;tag values&lt;/a&gt; and I want to view data for each tag key-value pair on its own graph. I’m using &lt;a href="https://github.com/influxdata/chronograf"&gt;Chronograf’s&lt;/a&gt; dashboards to visualize my data - is there a way to do what I want without having to create fifteen different graphs that have nearly identical queries?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;There is! Starting in &lt;a href="https://github.com/influxdata/chronograf/releases/tag/1.2.0-beta10"&gt;version 1.2.0-beta10&lt;/a&gt;, Chronograf supports dashboard template variables. Dashboard template variables offer the functionality that you’re looking for; they allow you to alter specific components of a cell’s query without having to navigate away from the dashboard or create several nearly-identical cells.&lt;/p&gt;

&lt;p&gt;Here’s an example of a dashboard template variable in action. The template variable &lt;code&gt;:frenchie-name:&lt;/code&gt; stores the three tag values (&lt;code&gt;brinkely&lt;/code&gt;, &lt;code&gt;princess&lt;/code&gt;, and &lt;code&gt;speckles&lt;/code&gt;) associated with a specific tag key. Change the data displayed in the dashboard graph by choosing the different tag values from the template variable dropdown.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8221" src="/images/legacy-uploads/tldr-template-gif.gif" alt="" width="1278" height="429" /&gt;&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;Query building in Chronograf&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’ve been using &lt;a href="https://github.com/influxdata/chronograf"&gt;Chronograf&lt;/a&gt; to create dashboards. I recently upgraded to &lt;a href="https://github.com/influxdata/chronograf/releases/tag/1.2.0-beta9"&gt;version 1.2.0-beta9&lt;/a&gt; and I’ve noticed that the raw query editor is missing; I can no longer select the &lt;code&gt;InfluxQL&lt;/code&gt; option when creating a new query in the Explorer. Is this feature gone? Can I manually edit a query in Chronograf in the current version?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Starting with version 1.2.0-beta9, we’ve effectively merged the raw query editor and the builder. We did this to improve the query creation process and make it more interactive. You can now move seamlessly between using the builder and manually editing the query; when possible, the interface automatically populates the builder with the information that you’ve entered manually.&lt;/p&gt;

&lt;p&gt;Here’s an example of how this might work. First, I build a query that selects just the &lt;code&gt;usage_idle&lt;/code&gt; &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#field-key"&gt;field key&lt;/a&gt;. Next, I manually add the &lt;code&gt;usage_user&lt;/code&gt; field key to the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#syntax"&gt;&lt;code&gt;SELECT&lt;/code&gt; clause&lt;/a&gt;. Notice that the builder automatically updates the &lt;code&gt;Field&lt;/code&gt; column with my change. Finally, I use the builder to remove that second &lt;code&gt;usage_user&lt;/code&gt; field key.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8223" src="/images/legacy-uploads/tldr-builder-gif-resized.gif" alt="" width="1278" height="1019" /&gt;&lt;/p&gt;
&lt;h2&gt;InfluxDB user management in Chronograf&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’m using &lt;a href="https://github.com/influxdata/chronograf"&gt;Chronograf version 1.2.0-beta10&lt;/a&gt; to manage users in my InfluxDB instance and I’ve noticed that I’m only able to assign admin status to users. The &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/authentication_and_authorization/#user-types-and-privileges"&gt;InfluxDB documentation&lt;/a&gt; discusses assigning &lt;code&gt;READ&lt;/code&gt; and &lt;code&gt;WRITE&lt;/code&gt; access to &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/authentication_and_authorization/#non-admin-users"&gt;non-admin users&lt;/a&gt; - is this something I can do in Chronograf?&lt;/p&gt;

&lt;p&gt;I can’t see a way to do it in the &lt;code&gt;Users&lt;/code&gt; section on the &lt;code&gt;Admin&lt;/code&gt; page. Here’s what my setup looks like:&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-8219" src="/images/legacy-uploads/tldr-users.png" alt="" width="1280" height="361" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Currently, Chronograf does not support assigning database &lt;code&gt;READ&lt;/code&gt; or &lt;code&gt;WRITE&lt;/code&gt; access to non-admin users. This is a known issue. As a workaround, grant &lt;code&gt;READ&lt;/code&gt;, &lt;code&gt;WRITE&lt;/code&gt;, or &lt;code&gt;ALL&lt;/code&gt; (&lt;code&gt;READ&lt;/code&gt; and &lt;code&gt;WRITE&lt;/code&gt;) permissions to non-admin users with the following curl commands, replacing anything inside &lt;code&gt;&amp;lt; &amp;gt;&lt;/code&gt; with your own values:&lt;/p&gt;
&lt;h4 id="grant-read-permission"&gt;Grant &lt;code&gt;READ&lt;/code&gt; permission:&lt;/h4&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;~# curl -XPOST "http://&amp;lt;InfluxDB-IP&amp;gt;:8086/query?u=&amp;lt;username&amp;gt;&amp;amp;p=&amp;lt;password&amp;gt;" --data-urlencode "q=GRANT READ ON &amp;lt;database-name&amp;gt; TO &amp;lt;non-admin-username&amp;gt;"&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id="grant-write-permission"&gt;Grant &lt;code&gt;WRITE&lt;/code&gt; permission:&lt;/h4&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;~# curl -XPOST "http://&amp;lt;InfluxDB-IP&amp;gt;:8086/query?u=&amp;lt;username&amp;gt;&amp;amp;p=&amp;lt;password&amp;gt;" --data-urlencode "q=GRANT WRITE ON &amp;lt;database-name&amp;gt; TO &amp;lt;non-admin-username&amp;gt;"&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id="grant-all-permission"&gt;Grant &lt;code&gt;ALL&lt;/code&gt; permission:&lt;/h4&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;~# curl -XPOST "http://&amp;lt;InfluxDB-IP&amp;gt;:8086/query?u=&amp;lt;username&amp;gt;&amp;amp;p=&amp;lt;password&amp;gt;" --data-urlencode "q=GRANT ALL ON &amp;lt;database-name&amp;gt; TO &amp;lt;non-admin-username&amp;gt;"&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In all cases, a successful &lt;code&gt;GRANT&lt;/code&gt; query returns a blank result:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;{"results":[{"statement_id":0}]}   &amp;lt;--- Success!&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Remove &lt;code&gt;READ&lt;/code&gt;, &lt;code&gt;WRITE&lt;/code&gt;, or &lt;code&gt;ALL&lt;/code&gt; permissions from non-admin users by replacing &lt;code&gt;GRANT&lt;/code&gt; with &lt;code&gt;REVOKE&lt;/code&gt; in the curl commands above.&lt;/p&gt;
&lt;h3&gt;What's next:&lt;/h3&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 04 May 2017 04:00:21 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-may-04-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-may-04-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR InfluxDB Tech Tips - Querying Data in a Non-DEFAULT Retention Policy, Checking Field Types, and Querying vs. Writing Booleans</title>
      <description>&lt;p&gt;&lt;span style="font-weight: 400;"&gt;In this post, we recap some new material that you might have missed in the past week or so. Check in next week for the most interesting TICK stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;/span&gt;&lt;a href="https://github.com/influxdata/influxdb/issues"&gt;&lt;span style="font-weight: 400;"&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;Community&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Querying data in a non-DEFAULT retention policy&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; I created a new &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#retention-policy-rp"&gt;retention policy&lt;/a&gt; called &lt;code&gt;secret_garden&lt;/code&gt;. I started writing data to that retention policy and the logs show that the writes are successful, but when I query the data I get an empty response. What am I doing wrong?&lt;/p&gt;

&lt;p&gt;Results of the &lt;code&gt;SHOW RETENTION POLICIES&lt;/code&gt; query:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SHOW RETENTION POLICIES ON "lands"
name	       duration	  shardGroupDuration   replicaN   DEFAULT
autogen	       0          168h0m0s             1          true
secret_garden  24h0m0s	  1h0m0s               1          false&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Results of a &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/"&gt;&lt;code&gt;SELECT&lt;/code&gt; query&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT * FROM "foliage"
&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;The retention policy &lt;code&gt;secret_garden&lt;/code&gt; is not the &lt;code&gt;DEFAULT&lt;/code&gt; retention policy for your database (see the fifth column in the &lt;code&gt;SHOW RETENTION POLICIES&lt;/code&gt; output).&lt;/p&gt;

&lt;p&gt;You’ll need to &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#description-of-syntax"&gt;fully qualify&lt;/a&gt; the &lt;code&gt;foliage&lt;/code&gt; &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#measurement"&gt;measurement&lt;/a&gt; if you’re querying data in a retention policy that is not the &lt;code&gt;DEFAULT&lt;/code&gt; retention policy. Fully qualify a measurement by specifying the database and retention policy in the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#from-clause"&gt;&lt;code&gt;FROM&lt;/code&gt; clause&lt;/a&gt;: &lt;code&gt;&amp;lt;"database"&amp;gt;.&amp;lt;"retention_policy"&amp;gt;.&amp;lt;"measurement"&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT * FROM "lands"."secret_garden"."foliage"
name: foliage
-------------
time                             roses
2016-05-31T17:09:04.697144667Z   3
2016-05-31T17:09:07.096708707Z   5&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Checking field types&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; Is there a way to see the &lt;a href="https://docs.influxdata.com/influxdb/latest/write_protocols/line_protocol_reference/#data-types"&gt;data type&lt;/a&gt; of a &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#field"&gt;field&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Starting with InfluxDB version 1.0, the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/#show-field-keys"&gt;&lt;code&gt;SHOW FIELD KEYS&lt;/code&gt; query&lt;/a&gt; also returns the field’s data type.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SHOW FIELD KEYS FROM all_the_types
name: all_the_types
-------------------
fieldKey  fieldType
blue      string
green     boolean
orange    integer
yellow    float&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Querying vs. writing booleans&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q: &lt;/b&gt;I’m able to successfully write &lt;a href="https://docs.influxdata.com/influxdb/latest/write_protocols/line_protocol_reference/#data-types"&gt;booleans&lt;/a&gt; to my database, but I can’t seem to use them in my query’s &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-where-clause"&gt;&lt;code&gt;WHERE&lt;/code&gt; clause&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; INSERT hamlet tobe=t
&amp;gt; INSERT hamlet tobe=f
&amp;gt; SELECT * FROM "hamlet" WHERE "tobe"=t
&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;A: &lt;/b&gt;Acceptable boolean syntax differs for writes and for queries.&lt;/p&gt;

&lt;p&gt;In your case, InfluxDB understands that &lt;code&gt;t&lt;/code&gt; means true when you write your data but it doesn’t understand that &lt;code&gt;t&lt;/code&gt; means true when you query your data. You’ll need to use &lt;code&gt;true&lt;/code&gt;, &lt;code&gt;True&lt;/code&gt;, or &lt;code&gt;TRUE&lt;/code&gt; to reference that boolean value in a query.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT * FROM "hamlet" WHERE "tobe"=true
name: hamlet
------------
time                             tobe
2016-05-31T18:07:32.93151244Z    true&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 27 Apr 2017 04:00:23 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-april-27-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-april-27-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR InfluxDB Tech Tips - Chronograf's Template Queries and Function Documentation's Make-over!</title>
      <description>&lt;p&gt;&lt;span style="font-weight: 400;"&gt;In this post, we recap some new material that you might have missed in the past week or so. Check in next week for the most interesting TICK stack related issues, workarounds, how-tos, and Q&amp;amp;A from &lt;/span&gt;&lt;a href="https://github.com/influxdata/influxdb/issues"&gt;&lt;span style="font-weight: 400;"&gt;GitHub&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt;, IRC, and the &lt;a href="https://community.influxdata.com/"&gt;InfluxData &lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;Community&lt;/span&gt;&lt;span style="font-weight: 400;"&gt;.&lt;/span&gt;&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Chronograf has template queries&lt;/h2&gt;
&lt;p&gt;Starting with version 1.2.0-beta8, &lt;a href="https://github.com/influxdata/chronograf"&gt;Chronograf’s&lt;/a&gt; data explorer supports query templates. Just click on the &lt;code&gt;Query Templates&lt;/code&gt; dropdown and select a &lt;code&gt;CREATE&lt;/code&gt;, &lt;code&gt;DROP&lt;/code&gt;, or &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/schema_exploration/"&gt;&lt;code&gt;SHOW&lt;/code&gt; query&lt;/a&gt; to enter it in the query input.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-7859" src="/images/legacy-uploads/bloggif.gif" alt="" width="1437" height="680" /&gt;&lt;/p&gt;
&lt;h2&gt;Function documentation gets a make-over&lt;/h2&gt;
&lt;p&gt;Last week we released an all-new version of the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/"&gt;functions documentation&lt;/a&gt;. Functions are an essential part of InfluxDB’s query language; they allow you to aggregate, transform, and analyze your time-series data. We hope the revised documentation helps you get to know functions and allows you to seamlessly integrate them into your monitoring solution.&lt;/p&gt;

&lt;p&gt;Among the various improvements, the new documentation includes:&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;In-depth syntax descriptions of each InfluxQL function&lt;/li&gt;
 	&lt;li&gt;Numerous practical examples using a &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#sample-data"&gt;sample dataset&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;Insights into &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#common-issues-with-functions"&gt;common issues&lt;/a&gt; with syntax and behavior&lt;/li&gt;
 	&lt;li&gt;Extended sections on &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#specify-multiple-functions-in-the-select-clause"&gt;specifying multiple functions in the &lt;code&gt;SELECT&lt;/code&gt; clause&lt;/a&gt; and on using the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#rename-the-output-field-key"&gt;&lt;code&gt;AS&lt;/code&gt; clause&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Tech tips get a webinar&lt;/h2&gt;
&lt;p&gt;Check out our Tech Tips webinar to get an overview of the blog entry highlights in the past quarter. The webinar goes into detail about InfluxQL’s &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#subqueries"&gt;subqueries&lt;/a&gt;, &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-into-clause"&gt;&lt;code&gt;INTO&lt;/code&gt; queries&lt;/a&gt;, new &lt;a href="https://docs.influxdata.com/influxdb/latest/tools/shell/"&gt;CLI&lt;/a&gt; features in version 1.2, and it offers a couple miscellaneous tips for working with InfluxDB and Chronograf.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;
&lt;iframe src="https://player.vimeo.com/video/212774069" width="640" height="400" frameborder="0" allowfullscreen="allowfullscreen"&gt;&lt;/iframe&gt;

&lt;p&gt;&lt;a href="https://vimeo.com/212774069"&gt;Quarterly Tech Tips - April 2017&lt;/a&gt; from &lt;a href="https://vimeo.com/influxdata"&gt;InfluxData Platform&lt;/a&gt; on &lt;a href="https://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 20 Apr 2017 04:00:41 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-april-20-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-april-20-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
    <item>
      <title>TL;DR InfluxDB Tech Tips - Missing Data with DISTINCT() &amp; the INTO Clause, Unexpected Timestamps with MAX() &amp; More</title>
      <description>&lt;p&gt;What happens when you cross a &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/"&gt;function&lt;/a&gt; with an &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-into-clause"&gt;&lt;code&gt;INTO&lt;/code&gt; clause&lt;/a&gt; or a &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#group-by-time-intervals"&gt;&lt;code&gt;GROUP BY time()&lt;/code&gt; clause&lt;/a&gt;? Occasionally, some curious results. In this post, we describe the unexpected when working with InfluxQL functions in the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-basic-select-statement"&gt;&lt;code&gt;SELECT&lt;/code&gt; statement&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;
&lt;h2&gt;Missing data with DISTINCT() and the INTO clause&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt;&lt;b&gt; &lt;/b&gt;I’m trying to write the results of the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#distinct"&gt;&lt;code&gt;DISTINCT()&lt;/code&gt; function&lt;/a&gt; to a different &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#measurement"&gt;measurement&lt;/a&gt;. The only thing is - the results of the query without the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#the-into-clause"&gt;&lt;code&gt;INTO&lt;/code&gt; clause&lt;/a&gt; and the results of the query with the &lt;code&gt;INTO&lt;/code&gt; clause are different. Is this the expected behavior? I have a feeling I’m missing something.&lt;/p&gt;

&lt;p&gt;Just &lt;code&gt;DISTINCT()&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT DISTINCT("personality_type") FROM "twins"

name: twins
time                  distinct
----                  --------
1970-01-01T00:00:00Z  a                 
1970-01-01T00:00:00Z  b                   &amp;lt;--- Three results!
1970-01-01T00:00:00Z  uncategorizable&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;DISTINCT()&lt;/code&gt; with &lt;code&gt;INTO&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT DISTINCT("personality_type") INTO "twin_types" FROM "twins"

name: result
time written
---- -------
1970-01-01T00:00:00Z 3      &amp;lt;--- Three written points!

&amp;gt; SELECT * FROM "twin_types"

name: twin_types
time                  distinct
----                  --------
1970-01-01T00:00:00Z  uncategorizable  &amp;lt;--- Just one point!&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;A: &lt;/strong&gt;The behavior that you’re seeing is the expected behavior; it comes down to how InfluxDB identifies a single &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#point"&gt;point&lt;/a&gt; and how it handles duplicate points.&lt;/p&gt;

&lt;p&gt;Notice that each result of the &lt;code&gt;DISTINCT()&lt;/code&gt; query without the &lt;code&gt;INTO&lt;/code&gt; clause has the same timestamp. InfluxDB assumes that points in the same &lt;a href="https://docs.influxdata.com/influxdb/latest/concepts/glossary/#series"&gt;series&lt;/a&gt; and with the same timestamp are duplicate points.&lt;/p&gt;

&lt;p&gt;When you add the &lt;code&gt;INTO&lt;/code&gt; clause to the query, InfluxDB writes three duplicate points to the &lt;code&gt;twin_types&lt;/code&gt; measurement. When the system encounters duplicate points, it simply overwrites the previous point with the most recent point so you end up with only one result in the destination measurement. It’s a little unexpected but that’s the explanation for what you’re seeing.&lt;/p&gt;
&lt;h2&gt;Unexpected timestamps with MAX() and the GROUP BY time() clause&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; &lt;b&gt; &lt;/b&gt;I’m trying to find the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#max"&gt;maximum&lt;/a&gt; number of eggs for specific time intervals. The results in the &lt;code&gt;max&lt;/code&gt; column are accurate but the timestamps in the &lt;code&gt;time&lt;/code&gt; column aren’t what I expected to see. I’ve included a simplified version of my data below. Why do the timestamps seem off?&lt;/p&gt;

&lt;p&gt;Raw data:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT * FROM "house"

name: house
time                  eggs
----                  ----
2017-04-12T20:00:00Z  1     &amp;lt;--- Max value in the first 20-minute interval
2017-04-12T20:10:00Z  0
2017-04-12T20:20:00Z  3
2017-04-12T20:30:00Z  5     &amp;lt;--- Max value in the second 20-minute interval&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My query:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT MAX("eggs") FROM "house" WHERE time &amp;gt;= '2017-04-12T20:00:00Z' AND time &amp;lt;= '2017-04-12T20:30:00Z' GROUP BY time(20m)

name: house
time                  max
----                  ---
2017-04-12T20:00:00Z  1
2017-04-12T20:20:00Z  5     &amp;lt;--- I'd expect this timestamp to be 2017-04-12T20:30:00Z&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;A: &lt;/strong&gt;The timestamps that you’re seeing are a consequence of the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#group-by-time-intervals"&gt;&lt;code&gt;GROUP BY time()&lt;/code&gt; clause&lt;/a&gt;. That clause automatically overrides &lt;code&gt;MAX()&lt;/code&gt;’s original timestamps with timestamps that mark the start of the relevant time interval.&lt;/p&gt;

&lt;p&gt;In your case, the second timestamp in the results (&lt;code&gt;2017-04-12T20:20:00Z&lt;/code&gt;) refers to the interval between &lt;code&gt;2017-04-12T20:20:00Z&lt;/code&gt; and just before &lt;code&gt;2017-04-12T20:30:00Z&lt;/code&gt;, not to when the maximum value occurred in the raw data. Almost all* queries that use an InfluxQL function with a &lt;code&gt;GROUP BY time()&lt;/code&gt; clause overwrite timestamps in this way.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The only exception is the &lt;code&gt;SAMPLE()&lt;/code&gt; function. See the &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#sample"&gt;&lt;code&gt;SAMPLE()&lt;/code&gt; documentation&lt;/a&gt; for additional information.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Unexpected consistency with ELAPSED() and the GROUP BY time() clause&lt;/h2&gt;
&lt;p&gt;&lt;b&gt;Q:&lt;/b&gt; &lt;b&gt; &lt;/b&gt;I’m using &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#elapsed"&gt;&lt;code&gt;ELAPSED()&lt;/code&gt;&lt;/a&gt; to calculate the time gap between &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/functions/#median"&gt;median&lt;/a&gt; values in my data. The results I get (see below) always show the same time gap. I’m having a hard time believing that my median values are always exactly ten minutes apart. Am I using the &lt;code&gt;ELAPSED()&lt;/code&gt; function correctly?&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-markup"&gt;&amp;gt; SELECT ELAPSED(MEDIAN("clicks"),1m) FROM "puppies" WHERE time &amp;gt;= '2017-04-12T18:30:00Z' AND time &amp;lt;= '2017-04-12T19:10:00Z' GROUP BY time(10m)

name: puppies
time                  elapsed
----                  -------
2017-04-12T18:40:00Z  10
2017-04-12T18:50:00Z  10
2017-04-12T19:00:00Z  10&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;A: &lt;/strong&gt;You’re using the &lt;code&gt;ELAPSED()&lt;/code&gt; function correctly from a syntax perspective but your query wont give you the results that you’re looking for. When you use &lt;code&gt;ELAPSED()&lt;/code&gt; with a nested function and a &lt;a href="https://docs.influxdata.com/influxdb/latest/query_language/data_exploration/#group-by-time-intervals"&gt;&lt;code&gt;GROUP BY time()&lt;/code&gt; clause&lt;/a&gt;, InfluxDB always returns elapsed values that are equal to the &lt;code&gt;GROUP BY time()&lt;/code&gt; interval.&lt;/p&gt;

&lt;p&gt;When you run your query, InfluxDB first calculates the results for the nested function (&lt;code&gt;MEDIAN()&lt;/code&gt;) at the specified &lt;code&gt;GROUP BY time()&lt;/code&gt; intervals and then it applies the &lt;code&gt;ELAPSED()&lt;/code&gt; function to those results. In the first step, the &lt;code&gt;GROUP BY time()&lt;/code&gt; clause automatically overrides &lt;code&gt;MEDIAN()&lt;/code&gt;’s original timestamps with timestamps that mark the start of the each &lt;code&gt;GROUP BY time()&lt;/code&gt; interval. When the system applies the &lt;code&gt;ELAPSED()&lt;/code&gt; function to the results of that first step, it encounters timestamps that are always ten minutes apart and not the original timestamps of the &lt;code&gt;MEDIAN()&lt;/code&gt; values.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;
&lt;h2&gt;What's next:&lt;/h2&gt;
&lt;ul&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;strong&gt;&lt;a href="https://w2.influxdata.com/downloads/"&gt;Downloads&lt;/a&gt;&lt;/strong&gt;&lt;span style="font-weight: 400;"&gt; for the TICK-stack are live on our "downloads" page.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on the Cloud: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Get started with a FREE trial of &lt;/span&gt;&lt;a href="https://cloud.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Cloud&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring fully-managed clusters, Kapacitor and Grafana.&lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Deploy on Your Servers: &lt;/b&gt;&lt;span style="font-weight: 400;"&gt;Want to run InfluxDB clusters on your servers? Try a FREE 14-day trial. of &lt;/span&gt;&lt;a href="https://portal.influxdata.com/"&gt;&lt;span style="font-weight: 400;"&gt;InfluxDB Enterprise&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; featuring an intuitive UI for deploying, monitoring, and rebalancing clusters, plus managing backups and restores. &lt;/span&gt;&lt;/li&gt;
 	&lt;li style="font-weight: 400;"&gt;&lt;b&gt;Tell Your Story:&lt;/b&gt; &lt;a href="https://w2.influxdata.com/testimonials/"&gt;&lt;span style="font-weight: 400;"&gt;Over 300 companies&lt;/span&gt;&lt;/a&gt;&lt;span style="font-weight: 400;"&gt; have shared their story on how InfluxDB is helping them succeed. Submit your testimonial and get a limited edition hoodie as a thank you.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <pubDate>Thu, 13 Apr 2017 04:00:54 -0700</pubDate>
      <link>https://www.influxdata.com/blog/tldr-influxdb-tech-tips-april-13-2017/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/tldr-influxdb-tech-tips-april-13-2017/</guid>
      <category>Product</category>
      <category>Developer</category>
      <author>Regan Kuchan (InfluxData)</author>
    </item>
  </channel>
</rss>
