Skip to content

Commit

Permalink
Propagate input id from the Agent policy into Filebeat configuration (#…
Browse files Browse the repository at this point in the history
…30386)

* Propage input id from the Agent policy into Filebeat configuration

This allow an ID defined on the Agent Policy for any inputs supported by
Filebeat to be propaged down to the Filebeat configuration.

Note: No validation is done on the field, if the field is present it will sent to
Filebeat.

Fixes: #30300
  • Loading branch information
ph committed Mar 16, 2022
1 parent 3ebfcb8 commit b318f6e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions x-pack/elastic-agent/CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,4 @@
- Add support for loading input configuration from external configuration files in standalone mode. You can load inputs from YAML configuration files under the folder `{path.config}/inputs.d`. {pull}30087[30087]
- Install command will skip install/uninstall steps when installation via package is detected on Linux distros. {pull}30289[30289]
- Add support for enabling the metrics buffer endpoint in the elastic-agent and beats it runs. diagnostics collect command will gather metrics-buffer data if enabled. {pull}30471[30471]
- Elastic Agent now propagates ID for Filebeat input. {pull}30386[30386]
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/pkg/agent/program/supported.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
filebeat:
inputs:
- index: logs-generic-default
- id: logfile-1
index: logs-generic-default
paths:
- /var/log/hello1.log
- /var/log/hello2.log
Expand Down Expand Up @@ -28,7 +29,8 @@ filebeat:
type: log
vars:
var: value
- index: testtype-generic-default
- id: logfile-2
index: testtype-generic-default
paths:
- /var/log/hello3.log
- /var/log/hello4.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ inputs:
dataset: ""
hosts: ["http://127.0.0.1:8080"]
- type: logfile
id: logfile-1
use_output: default
streams:
- paths:
Expand All @@ -61,6 +62,7 @@ inputs:
vars:
var: value
- type: logfile
id: logfile-2
data_stream:
type: testtype
use_output: default
Expand Down
2 changes: 1 addition & 1 deletion x-pack/elastic-agent/spec/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rules:
- copy_all_to_list:
to: streams
on_conflict: noop
except: ["streams", "id", "enabled", "processors"]
except: ["streams", "enabled", "processors"]
- copy_to_list:
item: processors
to: streams
Expand Down

0 comments on commit b318f6e

Please sign in to comment.