113
6.5.2. Direct link
To get direct link to a specific trend log click on Direct link button on bottom left part.
6.5.3. Trend logs functions
To process logged information in trends, you can use built in trend log functions from scripting.
Include library before calling trend log functions:
require('trends')
Include library before calling trend log functions
trends.fetch(name, dates, resolution)
trends.fetchone(name, dates, resolution)
Fetch one or many values for the given period
Parameters:
name trend log name, required
dates Lua table with two items - 'start' and 'end', each item must contain 'year', 'month',
'day' keys, required
resolution optional, will use trend resolution if not specified, set to 86400 for retreive
daily data
Return values:
fetch returns Lua table with values for the given period or nil on error. Number of values
depends on period, resolution and data retention settings
fetchone returns single value for the given period or nil on error
Example:
require('trends')
-- will fetch data between 2016.04.15 00:00 and 2016.04.16 00:00