Sinks
Sinks are methods for delivering data to external destinations.
Sinks are built into Substation applications to enable delivery of transformed data.
File-Based Sinks
Sinks that deliver file-like objects have specific settings that determine the path, format, and compression for each file.
file_path Settings
Determines how the name of the file is constructed.
Field | Type | Description | Required |
---|---|---|---|
Prefix | String | Prefix prepended to the file path. | No |
PrefixKey | String | Retrieves a value from an object that is used as the prefix prepended to the file path. If used, then this overrides Prefix. | No |
Suffix | String | Suffix appended to the file path. If UUID is not set, then this becomes the filename. | No |
SuffixKey | String | Retrieves a value from an object that is used as the suffix appended to the file path. If used, then this overrides Suffix. | No |
TimeFormat | String | TimeFormat inserts a formatted datetime string into the file path. Must be one of: - pattern-based layouts - unix: epoch (supports fractions of a second) - unix_milli: epoch milliseconds | No |
UUID | Bool | Inserts a random UUID into the file path. If a suffix is not set, then this becomes the filename. | No |
Extension | Bool | Determines if a file extension should be appended to the filename. | No |
Use Cases
Random, Date-Based Files
{
// creates the file pattern `year/month/day/uuid.extension`
file_path: {
time_format: '2006/01/02',
uuid: true,
extension: true,
}
}
Object-Defined Files
{
// creates the file pattern `d/e/f`
file_path: {
// a.b.c contains value 'd/e/f'
prefix_key: 'a.b.c'
}
}
file_format Settings
Determines the format of the file. These file formats are supported:
- data (binary, non-text data)
- json
- text
If the format type does not have a common file extension, then no extension is added to the file name.
Use Cases
Binary Data
{
file_format: {
type: 'data',
}
}
file_compression Settings
Determines the compression applied to the file. These compression codecs are supported:
- gzip (https://en.wikipedia.org/wiki/Gzip)
- snappy (https://en.wikipedia.org/wiki/Snappy_(compression))
- zstd (https://en.wikipedia.org/wiki/Zstd)
If the compression type does not have a common file extension, then no extension is added to the file name.
{
file_compression: {
type: 'zstd',
}
}
Updated over 2 years ago