Log Files
Log Files (file)
Append events to one or more files.
File binary json raw
Minimal example
output: file: path: ~JSON
{ "output": { "file": { "path": null } }}Contents
Fields
| Field | Type | Required | Description |
|---|---|---|---|
path Location | string | ✅ | Path to the file to be written. Can have ${} expansions. |
batch Processing | Batch | Batching input events together. | |
retry Reliability | Retry | Retry options. | |
input-field Processing | field (string) | Use the specified field as the content for the file line. Examples: data_field | |
compress-after Behavior | boolean (bool) | Compress the written file after the filename changes. | |
create-directories Behavior | boolean (bool) | Create parent directories for the given path if they do not exist. | |
file-per-event Behavior | boolean (bool) | Each event is written out to a new file, overwriting if needed. | |
truncate Behavior | boolean (bool) | Existing files are truncated before writing. | |
flush-at-end Processing | boolean (bool) | Don’t flush after each event. |
Processing
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
batch | Batch | Batching input events together. | |
input-field | field (string) | Use the specified field as the content for the file line. Examples: data_field | |
flush-at-end | boolean (bool) | Don’t flush after each event. |
Reliability
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
retry | Retry | Retry options. |
Location
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
path | string | ✅ | Path to the file to be written. Can have ${} expansions. |
Behavior
Show fields
| Field | Type | Required | Description |
|---|---|---|---|
compress-after | boolean (bool) | Compress the written file after the filename changes. | |
create-directories | boolean (bool) | Create parent directories for the given path if they do not exist. | |
file-per-event | boolean (bool) | Each event is written out to a new file, overwriting if needed. | |
truncate | boolean (bool) | Existing files are truncated before writing. |
Schema
Batch Fields
| Field | Type | Required | Description |
|---|---|---|---|
fixed-size | number (integer) | maximum number of events in an output batch. Examples: 42, 1.2e-10 | |
mode | Mode | ✅ | If ‘document’ send on end of document generated by input. If ‘fixed’, use fixed_size.Allowed values: fixed, document |
timeout | time-interval (string) | ✅ | interval after which the batch is sent, to keep throughput going (default 100ms). Examples: 500ms, 2h |
header | multiline-text (string) | put a header line before the batch. | |
footer | multiline-text (string) | put a header line after the last line of the batch. | |
use-document-marker | boolean (bool) | Enrich the job metadata with a document marker (for document handling in batch mode). | |
wrap-as-json | boolean (bool) | Format the output batch as a JSON array. |
Retry Fields
| Field | Type | Required | Description |
|---|---|---|---|
timeout | time-interval (string) | ✅ | timeout (e.g. 500ms, 2s etc. - default is 30). Examples: 500ms, 2h |
retries | number (integer) | number of retries. Examples: 42, 1.2e-10 |
Batch - Mode Options
| Value | Description |
|---|---|
fixed | Fixed |
document | Document |