Skip to content

SourcesFiles

Brian L. Troutwine edited this page Oct 5, 2017 · 1 revision

File sources match file paths on-disk and follow the files that match said pattern. For instance, if a file source is configured to match /var/log/**/*.log then any file which appears under a directory in /var/log and ends in .log will be followed--across truncations--by cernan. The files do not have to exist at cernan start: cernan will discover new files as it runs. The file source reads line-oriented log files from disk. This source will follow files across truncations in the manner of tail.

Individual lines are mapped onto the LogLine concept.

Configuration

The file source configuration options are as follows:

  • path :: the file path(s) to watch for lines
  • forwards :: the filters and/or sinks toward which forward [default: []]

The forward concept is described in detail here.

You may configure multiple file sources.

Example

[sources]
  [sources.files]
  [sources.files.var_log_logs]
  path = "/var/log/**/*.log"

  [sources.files.temporary_log]
  path = "/tmp/temporary.log"

The source files.var_log_logs will tail files whose paths match /var/log/**/*.log. The source files.temporary_log will match only /tmp/temporary.log. Cernan will discover and follow new matching files as they are created.