Skip to content

Commit

Permalink
Fix extra fields for Beats (#297)
Browse files Browse the repository at this point in the history
fixes #296

---------

Co-authored-by: Tobias Bauriedel <tobias.bauriedel@netways.de>
  • Loading branch information
widhalmt and tbauriedel authored Jan 17, 2024
1 parent 0305dfa commit 870f268
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions molecule/beats_peculiar/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
pattern: '^[[:space:]]+(at|\.{3})[[:space:]]+\b|^Caused by:'
negate: false
match: after
fields:
testfield: thisisatest
testfield2: thisisanothertest
elasticsearch_jna_workaround: true
elasticsearch_disable_systemcallfilterchecks: true
elasticstack_full_stack: false
Expand Down
8 changes: 8 additions & 0 deletions molecule/beats_peculiar/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,11 @@
when:
- beats_filebeat_version.stdout.find('8.4.1') == -1
- elasticstack_release == 8

- name: Ensure field is set correctly
ansible.builtin.lineinfile:
dest: /etc/filebeat/filebeat.yml
line: " testfield: thisisatest"
check_mode: true
register: _field
failed_when: _field.changed
1 change: 1 addition & 0 deletions molecule/elasticstack_default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@
success_msg: "'{{ item }}' was found in nodes.content"
with_inventory_hostnames: all
when: groups['elasticsearch'] | length > 1

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)

Check warning on line 138 in molecule/elasticstack_default/verify.yml

View workflow job for this annotation

GitHub Actions / lint_full / lint

138:1 [empty-lines] too many blank lines (1 > 0)
2 changes: 1 addition & 1 deletion roles/beats/templates/filebeat.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ filebeat.inputs:
{% endif %}
{% if beats_filebeat_log_inputs[input].fields is defined %}
{% for field in beats_filebeat_log_inputs[input].fields %}
{{ field }}
{{ field }}: {{ beats_filebeat_log_inputs[input].fields[field] }}
{% endfor %}
{% endif %}
{% endif %}
Expand Down

0 comments on commit 870f268

Please sign in to comment.