Cannot reload "enabled" configuration

I want to reload input configuration with external configuration file. However, it seems that the enabled option cannot be reloaded. Is there any workaround?

# filebeat.yml

filebeat.config.inputs:
  enabled: true
  path: inputs/*.yml
  reload.enabled: true
  reload.period: 3s

# other configurations
# inputs/input.yml

- type: log
  enabled: true        # After change this option to false, filebeat still consumes new messges from this input.
  ignore_older: 10m
  paths:
    - /tmp/error/*.log    # This option can be reloaded successfully

- type: log
  enabled: true
  ignore_older: 10m
  paths:
    - /tmp/info/*.log

The paths option can be reloaded successfully, however, the enabled option of input.yml file cannot be reloaded. After changing it to false, filebeat still consumes messages from the related input.

Is there any way to dynamically disable an input?

Regards

Hey!

I was able to achieve this by "copying" what happens with modules (modules.d directory). So I have the directory the inputs and each input is defined in its own file like error.yml, info,yml.
When i want to disable an input I just rename the file to error.yml.disabled and Filebeat stops collecting logs from it.

Let me know what you think.

Hi @ChrsMark

I want to disable some inputs dynamically, and your solution works for me.

Thanks a lot!

Regards

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