Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are a few ways to read files in a specific order using filebeat:

  1. Specify the file paths in the same order they need to be read in the filebeat prospectors configuration file. For example:
- type: log
  paths:
    - /path/to/file1.log
    - /path/to/file2.log
    - /path/to/file3.log
  1. Use the exclude_lines or include_lines options to filter the files being read based on a specific pattern. For example, if your files are named in a specific order, you can include a pattern that matches that order:
- type: log
  paths:
    - /path/to/files/*.log
  include_lines: ['file-01', 'file-02', 'file-03']
  1. Use the harvester options to control how filebeat reads files. For example, you can set the harvester.backoff and harvester.max_backoff options to wait a specific amount of time before reading the next file. This can be useful for ensuring that files are read in a specific order:
- type: log
  paths:
    - /path/to/files/*.log
  harvester.backoff: 5s
  harvester.max_backoff: 10s