Time and UnixMilli
less than a minute
The Time Converter coverts a string into the time.Time type. This type is not used by Edge Delta. The timestamp field in Edge Delta is a UnixMilli int64 format so it needs to be converted further.
set(timestamp, UnixMilli(Time(attributes["timestamp"], "%Y-%m-%dT%H:%M:%SZ")))
This node converts the extracted timestamp into a standardized Unix Millisecond format as follows:
set: This function is used to assign a value to thetimestampfield.attributes["timestamp"]: This is accessing a value that is stored in theattributesmap with the keytimestamp.Time: This function converts a string representation of a time to atime.Timeobject. The format used here is%Y-%m-%dT%H:%M:%SZ, which corresponds to the ISO 8601 standard format for representing date and time (e.g.,2023-01-01T00:00:00Z). See the list of substitutions here.UnixMilli: This function converts atime.Timeobject into a Unix time.
For comprehensive timestamp management in Edge Delta, see:
- Manage Log Timestamps with Edge Delta - Complete guide to timestamp handling
- Parse Timestamp Processor - Dedicated processor for timestamp parsing
- Quick Start: Timestamp Pipeline Configuration - Hands-on example of timestamp processing