File Input
Configures a input file path or glob pattern from which to read events to transform into typed TenXObjects.
This input does NOT tail its target file/glob. To tail files on disk, use a forwarder input.
Configuration
To configure the File input module, Edit these settings.
Below is the default configuration from: file/config.yaml.
ewogICJ0eXBlIiA6ICJvYmplY3QiLAogICJwcm9wZXJ0aWVzIiA6IHsKICAgICJpbmNsdWRlIiA6IHsKICAgICAgInR5cGUiIDogInN0cmluZyIKICAgIH0sCiAgICAidGVueCIgOiB7CiAgICAgICJ0eXBlIiA6ICJzdHJpbmciCiAgICB9LAogICAgImlucHV0RmlsZSIgOiB7CiAgICAgICJ0eXBlIiA6ICJhcnJheSIsCiAgICAgICJpdGVtcyIgOiB7CiAgICAgICAgInR5cGUiIDogIm9iamVjdCIsCiAgICAgICAgImFkZGl0aW9uYWxQcm9wZXJ0aWVzIiA6IGZhbHNlLAogICAgICAgICJwcm9wZXJ0aWVzIiA6IHsKICAgICAgICAgICJuYW1lIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJzdHJpbmciLAogICAgICAgICAgICAgICJudWxsIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiTG9naWNhbCBuYW1lIG9mIHRoaXMgaW5wdXRcblxuU2V0cyBhIGxvZ2ljYWwgbmFtZSAoZS5nLiwgJ215SW5wdXQnKSBmb3IgdGhpcyBpbnB1dC4gVGhlIFtpbnB1dE5hbWVdKGh0dHBzOi8vZG9jLmxvZzEweC5jb20vYXBpL2pzLyNUZW5YQmFzZU9iamVjdCtpbnB1dE5hbWUpIGZpZWxkICByZXR1cm5zIHRoaXMgdmFsdWUgYXQgcnVuIHRpbWUgdG8gYWxsb3cgZm9yIGlkZW50aWZ5aW5nIGFuZCBvcGVyYXRpbmcgb24gaW5zdGFuY2VzIG9yaWdpbmF0aW5nIGZyb20gdGhpcyBpbnB1dC4iCiAgICAgICAgICB9LAogICAgICAgICAgInBhdGgiIDogewogICAgICAgICAgICAidHlwZ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x0OiB0cnVlKSIsCiAgICAgICAgICAgICJkZWZhdWx0IiA6IHRydWUKICAgICAgICAgIH0sCiAgICAgICAgICAiZXh0cmFjdG9ycyIgOiB7CiAgICAgICAgICAgICJ0eXBlIiA6IFsKICAgICAgICAgICAgICAiYXJyYXkiLAogICAgICAgICAgICAgICJudWxsIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiSlNPTiAvIHJlZ2V4IGV4dHJhY3RvciBuYW1lc1xuXG5EZWZpbmVzIGEgbGlzdCBvZiBKU09OL3JlZ2V4IGV4dHJhY3RvciBuYW1lcyB0byBjYXB0dXJlIGV2ZW50cyBmcm9tICdpbnB1dEZpbGVQYXRoJyB0byB0cmFuc2Zvcm0gaW50byBUZW5YT2JqZWN0cy4gRWFjaCBpdGVtIGluIHRoZSBsaXN0IHNob3VsZCBtYXAgdG8gYW4gZXh0cmFjdG9yIGRlZmluZWQgdmlhIGEgY29uZmlndXJhdGlvbiBmaWxlIG9yIHN0YXJ0dXAgYXJndW1lbnRzIGdyb3VwLiBUbyBsZWFybiBtb3JlIHNlZTogW2V4dHJhY3RvcnNdKGh0dHBzOi8vZG9jLmxvZzEweC5jb20vcnVuL2lucHV0L2V4dHJhY3QpLiIsCiAgICAgICAgICAgICJpdGVtcyIgOiB7CiAgICAgICAgICAgICAgInR5cGUiIDogInN0cmluZyIKICAgICAgICAgICAgfQogICAgICAgICAgfSwKICAgICAgICAgICJzb3VyY2VQYXR0ZXJuIiA6IHsKICAgICAgICAgICAgInR5cGUiIDogWwogICAgICAgICAgICAgICJzdHJpbmciLAogICAgICAgICAgICAgICJudWxsIgogICAgICAgICAgICBdLAogICAgICAgICAgICAibWFya2Rvd25EZXNjcmlwdGlvbiIgOiAiRXZlbnQgc291cmNlIGNhcHR1cmUgcmVnZXggcGF0dGVyblxuXG5EZWZpbmVzIGEgcmVnZXggcGF0dGVybiB0byBjYXB0dXJlICdzb3VyY2UnIHZhbHVlcy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dGhyb3VnaHB1dCBzdGF0cyB0byB0aGUgY29uc29sZVxuXG5TZXRzIHdoZXRoZXIgdGhpcyBpbnB1dCBwcmludHMgdGhyb3VnaHB1dCBzdGF0cyB0byB0aGUgY29uc29sZSAoQWNjZXB0cyBib29sZWFuIG9yIHN0cmluZyB3aXRoICQ9IHByZWZpeCBmb3IgcnVudGltZSBldmFsdWF0aW9uKSIKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgIH0KICB9LAogICJhZGRpdGlvbmFsUHJvcGVydGllcyIgOiBmYWxzZQp9
# 🔟❎ 'run' File input configuration
# Configure file/glob event inputs. To learn more https://doc.log10x.com/run/input/file
# NOTE: input files are read once and are not tailed. To continuously tail files
# use 10x in conjunction with any of the supported file forwarders in:
# https://doc.log10x.com/run/input/forwarder (e.g., Fluentd/Bit, Logstash, Filebeat)
# Set the 10x pipeline to 'run'
tenx: run
# =============================== Dependencies ================================
include: run/modules/input/file
# =============================== File Options ================================
# Multiple file inputs can be defined below
inputFile:
# ---------------------------- General Options ----------------------------
# 'name' sets a unique logical name across all pipeline inputs
- name: fileInput
# ---------------------------- File Options ---------------------------------
# 'path' specifies an absolute/canonical glob file path.
path: $=path("data/sample/input/[!{.}]*.log")
# ---------------------------- Parsing Options ----------------------------
# 'extractors' defines a list of JSON/regex extractor names
# used to capture and redact event values from 'path' to transform
# into TenXObjects. To learn more see: https://doc.log10x.com/run/input/extract
extractors: [
]
# 'sourcePattern' defines a regex pattern that captures a 'source' value
# for each event read from a file to transform into an TenXObject.
# This value will be used to sequence all events sharing this 'source' value correctly
# so they are not mixed with events originating from different locations.
sourcePattern: null
# 'sourceFields' defines a list of JSON fields to extract from matching capture groups of the inputFileSourcePattern
# or the entire event if not set as the 'source' value for each event read from this input.
sourceFields: [
]
# --------------------------- Ancillary Options ---------------------------
# 'printProgress' controls whether a progress gage is printed to the console
printProgress: true
Options
Specify the options below to configure multiple File input:
| Name | Description |
|---|---|
| inputFileName | Logical name of this input |
| inputFilePath | A file path or glob pattern to read from |
| inputFileEnabled | Enable/disable this file input |
| inputFileExtractors | JSON / regex extractor names |
| inputFileSourcePattern | Event source capture regex pattern |
| inputFileSourceFields | Event source JSON fields |
| inputFilePrintProgress | Sets whether this input prints throughput stats to the console |
inputFileName
Logical name of this input.
| Type | Default |
|---|---|
| String | "" |
Sets a logical name (e.g., 'myInput') for this input. The inputName field returns this value at run time to allow for identifying and operating on instances originating from this input.
inputFilePath
A file path or glob pattern to read from.
| Type | Default |
|---|---|
| File | path("\<user.dir>/data/sample/[!{.}]*.log") |
specifies a path that is either an absolute or canonical file path. For example:
inputFileEnabled
Enable/disable this file input.
| Type | Default |
|---|---|
| Boolean | true |
Specifies whether the open the input to read events from the target inputFilePath.
inputFileExtractors
JSON / regex extractor names.
| Type | Default |
|---|---|
| List | [] |
Defines a list of JSON/regex extractor names to capture events from 'inputFilePath' to transform into TenXObjects. Each item in the list should map to an extractor defined via a configuration file or startup arguments group. To learn more see: extractors.
inputFileSourcePattern
Event source capture regex pattern.
| Type | Default |
|---|---|
| String | "" |
Defines a regex pattern to capture 'source' values for each event read from this input.
Source values provide a method for sequencing TenXObjects read from this input in separate logical queues.
For example, capturing a 'host' or 'fileName' value as a 'source' creates a separate logical queue for each unique file/host origin by which TenXObjects read from this input are aggregated and written to output.
The source member returns each TenXObject's assigned value at run time. .
inputFileSourceFields
Event source JSON fields.
| Type | Default |
|---|---|
| List | [] |
Defines a list of JSON fields to extract from matching capture groups of inputFileSourcePattern or the entire event if not set as the 'source' value for each event read from this input.
Source values provide a method for sequencing TenXObjects read from this input in separate logical queues.
For example, capturing a 'host' or 'fileName' value as a 'source' creates a separate logical queue for each unique file/host origin by which TenXObjects read from this input are aggregated and written to output.
The source member returns each TenXObject's assigned value at run time.
inputFilePrintProgress
Sets whether this input prints throughput stats to the console.
| Type | Default |
|---|---|
| Boolean | false |
Sets whether this input prints throughput stats to the console.
This module is defined in file/module.yaml.