Use Stellar to Transform Sensor Data Elements
You can use Stellar to customize sensor data elements to more useful information.
For example, you can transform a timestamp to be specific to your timezone:
TO_EPOCH_TIMESTAMP(timestamp, 'yyyy-MM-dd HH:mm:ss', MAP_GET(dc, dc2tz, 'UTC'))
For a message with a
timestamp and dc
field, transform the timestamp to an epoch timestamp given
a timezone that you can look up in a separate map, called dc2tz
.
This converts the timestamp field to an epoch timestamp based on the following:
-
Format yyyy-MM-dd HH:mm:ss
-
The value in
dc2tz
associated with the value associated with fielddc
, defaulting toUTC
For a list of Stellar transformation functions supported by HCP, see Stellar Language Quick Reference.