Is there a way to change the filebeat.prospectors paths from command line?

Hello, i am fairly new to Filebeat and would like to do change the filebeat.yml entry
"- input_type: log

Paths that should be crawled and fetched. Glob based paths.

paths:
- D:\whatever\here.log

" upon starting Filebeat with command line to - D:\somewhere\here.log
with something like this

filebeat.exe -filebeat.yml - paths: - D:\somewhere\here.log

Is that at all possible or do i have to change the filebeat with something else beforehand?
The reason i am asking this, is because i have many agents on which i run Filebeat and sometimes the directory changes in which logs are being stored. Thank you

See Config file format docs.

The full path to the first entry prospectors path entry is filebeat.prospectors.0.paths.0. Via -E you can pass settings. -E also has support for JSON-like arrays.

Preparing the config file a little for more convenience:

filebeat.prospectors:
- input_type: log
  paths: ${logs.paths}

logs.paths:
  - 'D:\default\path'

I can run filebeat via

fielbeat.exe -c X:\path\to\filebeat.yml -E logs.paths='path1,path2,path3'

1 Like

Cool, that was exactly what i was looking for, thanks a lot!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.