Skip to content

Log Files

Log Files (files)

Monitor one or more log files for new lines.

File binary json raw

Minimal example

input:
files:
path: ""
JSON
{
"input": {
"files": {
"path": ""
}
}
}

Contents

Fields

FieldTypeRequiredDescription
path Locationpath (string)a path with wildcards identifying files to be read.
Examples: /path/to/file, c:\users\joe\data\file.txt
encoding Behaviorencoding (string)the text encoding for the monitored files.
Examples: UTF-8
include Locationpath[] (string)any other paths to be included.
Examples: /path/to/file, c:\users\joe\data\file.txt
exclude Locationpath[] (string)paths to be excluded.
Examples: /path/to/file, c:\users\joe\data\file.txt
ignore-older-than Filteringnumber (integer)ignore files older than this (epoch time in seconds).
Examples: 42, 1.2e-10
glob-minimum-cooldown Performancenumber (integer)pause after scanning for new files (in milliseconds).
Examples: 42, 1.2e-10
stop-reading-after Behaviorboolean (bool)do not wait for new files.
ignore-line-breaks Behaviorboolean (bool)consume each file as one event.
payload-mode BehaviorPayload ModeSelect how file content should be interpreted (auto, json, raw, binary).
Allowed values: auto, json, raw, binary
remove-after Behaviornumber (integer)remove files that are done reading after this period (seconds).
Examples: 42, 1.2e-10
fingerprinting ReliabilityFingerprintingFile fingerprinting strategy.
oldest-first Behaviorboolean (bool)default is youngest first.
file-path-field Object Propertiesfield (string)fill this field with the file we are currently reading from.
Examples: data_field
file-basename Behaviorboolean (bool)the file-path-field path will be the basename (e.g. ‘/path/frodo.txt’ becomes just ‘frodo’).
start-at-beginning Behaviorboolean (bool)ignore stored checkpoints and re-read all specified files.
json Behaviorboolean (bool)assume lines are already JSON.
max-read-size Performancenumber (integer)will not attempt to read files larger than this.
Examples: 42, 1.2e-10
max-line-size Performancenumber (integer)will not attempt to read lines longer than this.
Examples: 42, 1.2e-10

Location

Show fields
FieldTypeRequiredDescription
pathpath (string)a path with wildcards identifying files to be read.
Examples: /path/to/file, c:\users\joe\data\file.txt
includepath[] (string)any other paths to be included.
Examples: /path/to/file, c:\users\joe\data\file.txt
excludepath[] (string)paths to be excluded.
Examples: /path/to/file, c:\users\joe\data\file.txt

Behavior

Show fields
FieldTypeRequiredDescription
encodingencoding (string)the text encoding for the monitored files.
Examples: UTF-8
stop-reading-afterboolean (bool)do not wait for new files.
ignore-line-breaksboolean (bool)consume each file as one event.
payload-modePayload ModeSelect how file content should be interpreted (auto, json, raw, binary).
Allowed values: auto, json, raw, binary
remove-afternumber (integer)remove files that are done reading after this period (seconds).
Examples: 42, 1.2e-10
oldest-firstboolean (bool)default is youngest first.
file-basenameboolean (bool)the file-path-field path will be the basename (e.g. ‘/path/frodo.txt’ becomes just ‘frodo’).
start-at-beginningboolean (bool)ignore stored checkpoints and re-read all specified files.
jsonboolean (bool)assume lines are already JSON.

Filtering

Show fields
FieldTypeRequiredDescription
ignore-older-thannumber (integer)ignore files older than this (epoch time in seconds).
Examples: 42, 1.2e-10

Performance

Show fields
FieldTypeRequiredDescription
glob-minimum-cooldownnumber (integer)pause after scanning for new files (in milliseconds).
Examples: 42, 1.2e-10
max-read-sizenumber (integer)will not attempt to read files larger than this.
Examples: 42, 1.2e-10
max-line-sizenumber (integer)will not attempt to read lines longer than this.
Examples: 42, 1.2e-10

Reliability

Show fields
FieldTypeRequiredDescription
fingerprintingFingerprintingFile fingerprinting strategy.

Object Properties

Show fields
FieldTypeRequiredDescription
file-path-fieldfield (string)fill this field with the file we are currently reading from.
Examples: data_field

Schema

Fingerprinting Options

OptionNameTypeDescription
checksumChecksumobjectFingerprint strategy is set to a checksum of the start of the file determined by the bytes that are skipped (ignored-header-bytes) and then the fingerprint size in bytes.
first-line-checksumFirst Line ChecksumobjectFingerprint strategy that uses the first line of the file to detect if a file has changed.
dev-inodeDev InodesymbolFingerprint strategy is set to the inode of the file causing the file monitor to detect new files when a file is recreated.
Allowed values: fingerprinter-dev-inode

Fingerprinting - Checksum Fields

FieldTypeRequiredDescription
fingerprint-bytesnumber (integer)The number of bytes to use for the fingerprint, starts after ignore-header-bytes if specified.
Examples: 42, 1.2e-10
ignored-header-bytesnumber (integer)The number of bytes from the start of the file to ignore before starting the fingerprint.
Examples: 42, 1.2e-10

Fingerprinting - First Line Checksum Fields

FieldTypeRequiredDescription
max-line-lengthnumber (integer)The maximum number of bytes to read from the first line of the file to calculate the fingerprint.
Examples: 42, 1.2e-10

Payload Mode Options

ValueDescription
autoAuto
jsonJson
rawRaw
binaryBinary

Fingerprinting - Dev Inode Options

ValueDescription
fingerprinter-dev-inodeFingerprint strategy is set to the inode of the file causing the file monitor to detect new files when a file is recreated