Skip to content

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

FieldTypeRequiredDescription
path LocationstringPath to the file to be written. Can have ${} expansions.
batch ProcessingBatchBatching input events together.
retry ReliabilityRetryRetry options.
input-field Processingfield (string)Use the specified field as the content for the file line.
Examples: data_field
compress-after Behaviorboolean (bool)Compress the written file after the filename changes.
create-directories Behaviorboolean (bool)Create parent directories for the given path if they do not exist.
file-per-event Behaviorboolean (bool)Each event is written out to a new file, overwriting if needed.
truncate Behaviorboolean (bool)Existing files are truncated before writing.
flush-at-end Processingboolean (bool)Don’t flush after each event.

Processing

Show fields
FieldTypeRequiredDescription
batchBatchBatching input events together.
input-fieldfield (string)Use the specified field as the content for the file line.
Examples: data_field
flush-at-endboolean (bool)Don’t flush after each event.

Reliability

Show fields
FieldTypeRequiredDescription
retryRetryRetry options.

Location

Show fields
FieldTypeRequiredDescription
pathstringPath to the file to be written. Can have ${} expansions.

Behavior

Show fields
FieldTypeRequiredDescription
compress-afterboolean (bool)Compress the written file after the filename changes.
create-directoriesboolean (bool)Create parent directories for the given path if they do not exist.
file-per-eventboolean (bool)Each event is written out to a new file, overwriting if needed.
truncateboolean (bool)Existing files are truncated before writing.

Schema

Batch Fields

FieldTypeRequiredDescription
fixed-sizenumber (integer)maximum number of events in an output batch.
Examples: 42, 1.2e-10
modeModeIf ‘document’ send on end of document generated by input. If ‘fixed’, use fixed_size.
Allowed values: fixed, document
timeouttime-interval (string)interval after which the batch is sent, to keep throughput going (default 100ms).
Examples: 500ms, 2h
headermultiline-text (string)put a header line before the batch.
footermultiline-text (string)put a header line after the last line of the batch.
use-document-markerboolean (bool)Enrich the job metadata with a document marker (for document handling in batch mode).
wrap-as-jsonboolean (bool)Format the output batch as a JSON array.

Retry Fields

FieldTypeRequiredDescription
timeouttime-interval (string)timeout (e.g. 500ms, 2s etc. - default is 30).
Examples: 500ms, 2h
retriesnumber (integer)number of retries.
Examples: 42, 1.2e-10

Batch - Mode Options

ValueDescription
fixedFixed
documentDocument