File Destination
The File destination writes each processed message to the local filesystem. It supports filename templates with dynamic variables and configurable write modes, making it useful for archiving, audit trails, and batch file drops.
Configuration
Section titled “Configuration”Add a File destination to a channel in intu.yaml:
destinations: - name: archive type: file properties: scheme: local directory: "/data/outbound/hl7" filename_pattern: "${messageId}.hl7"Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
scheme | string | local | Storage scheme. Currently only local is supported. |
directory | string | (required) | Target directory. Created automatically if it does not exist. |
filename_pattern | string | ${messageId}.dat | Template for the output filename. Supports the variables listed below. |
mode | string | overwrite | Write mode: overwrite replaces existing files, append adds to the end. |
file_permissions | string | 0644 | Unix file permission bits applied to created files. |
Filename Pattern Variables
Section titled “Filename Pattern Variables”| Variable | Description | Example Value |
|---|---|---|
${messageId} | Unique message identifier | a1b2c3d4-e5f6-7890 |
${timestamp} | Unix timestamp in milliseconds | 1718472000000 |
${channelId} | ID of the channel processing the message | patient-sync |
${date} | Current date in YYYYMMDD format | 20260315 |
${time} | Current time in HHmmss format | 143052 |
Combine variables to build descriptive filenames:
filename_pattern: "${channelId}_${date}_${time}_${messageId}.hl7"# → patient-sync_20260315_143052_a1b2c3d4-e5f6-7890.hl7Complete Example
Section titled “Complete Example”A File destination that appends messages to a daily log file:
destinations: - name: daily-archive type: file properties: scheme: local directory: "/data/archive/adt" filename_pattern: "adt_${date}.log" mode: append file_permissions: "0640"