Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format time in influxdb select query

Tags:

influxdb

I am new to InfluxDB. I am querying data in admin ui. I see time as timestamp. Is it possible to see it formatted as date and time?

like image 937
PolinaC Avatar asked Jul 25 '15 22:07

PolinaC


People also ask

What time format does InfluxDB use?

InfluxDB uses a host's local time in UTC to assign timestamps to data; if hosts' clocks aren't synchronized with NTP, the timestamps on the data written to InfluxDB can be inaccurate.

What is group by time in InfluxDB?

Basic GROUP BY time() queries rely on the time_interval and on the InfluxDB database's preset time boundaries to determine the raw data included in each time interval and the timestamps returned by the query.

How do I select in InfluxDB?

Selecting tag keys in the SELECT clauseA query requires at least one field key in the SELECT clause to return data. If the SELECT clause only includes a single tag key or several tag keys, the query returns an empty response. This behavior is a result of how the system stores data.

What is precision in InfluxDB?

The precision of the timestamp can be controlled to return hours (h), minutes (m), seconds (s), milliseconds (ms), microseconds (u) or nanoseconds (ns). A special precision option is RFC3339 which returns the timestamp in RFC3339 format with nanosecond precision.


2 Answers

You can select RFC 3339 formatting by entering the following command in the CLI:

precision rfc3339 
like image 74
thierry Avatar answered Oct 02 '22 18:10

thierry


To convert influxdb timestamp to normal timestamp you can type on console:

influx -precision rfc3339

Now try with your query it should work.

For more details follow link : https://www.influxdata.com/blog/tldr-influxdb-tech-tips-august-4-2016/

like image 20
Viraj Wadate Avatar answered Oct 02 '22 18:10

Viraj Wadate