I need to develop an InfluxDB Time Series. The time series needs to contain the following information:
- time - The time the data was recorded. This will use the InfluxDB Time Field.
- value - The value for the time series. A simple integer.
- date - A separate date associated with the value. This date has nothing to do with the "time" field. It will be used to help narrow down queries.
My current line of thinking is to save the above "date" field as a separate "column" in the time series so that I can use the "where" clause to filter the data using that date. However I am struggling with how to represent that. Does InfluxDB support any kind of date or date/time fields? For the "time" field it seems to just use milliseconds. However if I try the same in a field with a different name, then the normal time queries don't work. So for example:
select * from myseries where time > now() - 1d
The above query will work just fine.
vs
select * from myseries where date > now() - 1d
This query will fail with an error because it doesn't seem to know how to treat "date" as a time value.
Is there a better representation for dates in this scenario?