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.

FieldTypeDescriptionRequired
PrefixStringPrefix prepended to the file path.No
PrefixKeyStringRetrieves a value from an object that is used as the prefix prepended to the file path. If used, then this overrides Prefix.No
SuffixStringSuffix appended to the file path. If UUID is not set, then this becomes the filename.No
SuffixKeyStringRetrieves a value from an object that is used as the suffix appended to the file path. If used, then this overrides Suffix.No
TimeFormatStringTimeFormat 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
UUIDBoolInserts a random UUID into the file path. If a suffix is not set, then this becomes the filename.No
ExtensionBoolDetermines 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:

If the compression type does not have a common file extension, then no extension is added to the file name.

{
  file_compression: {
    type: 'zstd',
  }
}