Live Workshop: Integrate Google SecOps with Bindplane - Join Us on February 26th at 11 AM ET!Sign Up Now

File

warning

This source offers a delete_after_read option that can be hazardous. When this option is combined with file globbing, it will delete every file that matches the globbing pattern. Use with caution and care.


Supported Platforms

PlatformMetricsLogsTraces
Linux
Windows
macOS

Configuration Table

ParameterTypeDefaultDescription
file_path*stringsFile or directory paths to tail for logs.
exclude_file_pathstrings""File or directory paths to exclude.
log_typestring"file"A friendly name that will be added to each log entry as an attribute.
multiline_line_start_patternstringRegex pattern that matches the beginning of a log entry for handling multiline logs.
multiline_line_end_patternstringRegex pattern that matches the end of a log entry, useful for terminating parsing of multiline logs.
encodingenumutf-8The encoding of the file being read. Valid values are nop, utf-8, utf-16le, utf-16be, ascii, and big5.
compressionenumnoneIndicate the compression format of input files. If set accordingly, files will be read using a reader that decompresses the file before scanning its content. Valid values are none or gzip. Requires start_at to be set to beginning. Ensure that your collector has permission to decompress the file.
include_file_name_attributebooltrueWhether to add the file name as the attribute log.file.name.
include_file_path_attributeboolfalseWhether to add the file path as the attribute log.file.path.
include_file_name_resolvedboolfalseWhether to add the file name after symlinks resolution as the attribute log.file.name_resolved.
include_file_path_resolvedboolfalseWhether to add the file path after symlinks resolution as the attribute log.file.path_resolved.
delete_after_readboolfalseWhether to delete the file(s) after reading. Only valid in combination start_at: beginning.
offset_storage_dirstring$OIQ_OTEL_COLLECTOR_HOME/storageThe directory where the offset storage file will be created. It is okay if multiple receivers use the same directory. By default, the Bindplane Distro for OpenTelemetry Collector sets $OIQ_OTEL_COLLECTOR_HOME in its runtime.
poll_intervalint200The duration of time in milliseconds between filesystem polls.
max_concurrent_filesint1024The maximum number of log files from which logs will be read concurrently. If the number of files matched exceeds this number, then files will be processed in batches.
parse_tostringbodyThe field that the log will be parsed to. Some exporters handle logs favorably when parsed to attributes over body and vice versa.
start_atenumendStart reading the file from the 'beginning' or 'end'.
*required field

Parsing

For the latest version of the filelog source, parsing capabilities have been removed. To replace this functionality, add a processor to your pipeline.

To parse JSON data from a file, add the Parse JSON Processor.

To parse data from a file using regex, add the Parse with Regex Processor.