Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion filebeat/config.sls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% from "filebeat/map.jinja" import conf with context %}

{% if salt['pillar.get']('filebeat:logstash:tls:enabled', False) %}
{% if salt['pillar.get']('filebeat:logstash:tls:use_custom_ca', False) %}
{{ salt['pillar.get']('filebeat:logstash:tls:ssl_cert_path', '/etc/pki/tls/certs/logstash-forwarder.crt') }}:
file.managed:
- source: {{ salt['pillar.get']('filebeat:logstash:tls:ssl_cert', 'salt://filebeat/files/ca.pem') }}
Expand Down
3 changes: 3 additions & 0 deletions filebeat/files/filebeat.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ filebeat:
input_type: {{ log_path.get('input_type', 'log') }}
document_type: {{ log_path.get('document_type', 'syslog') }}
ignore_older: {{ log_path.get('ignore_older', '24h') }}
tail_files: {{ log_path.get('tail_files', 'false') }}
scan_frequency: {{ log_path.get('scan_frequency', '10s') }}
backoff: {{ log_path.get('backoff', '1s') }}
max_backoff: {{ log_path.get('max_backoff', '10s') }}
Expand Down Expand Up @@ -61,10 +62,12 @@ output:
{%- if 'tls' in logstash %}
{%- if logstash.tls.get('enabled', False) %}
tls:
{%- if logstash.tls.get('use_custom_ca', False) %}
certificate_authorities: ["{{ logstash.tls.ssl_cert_path }}"]
{%- endif %}
{%- endif %}
{%- endif %}
{%- endif %}

shipper:

Expand Down
3 changes: 3 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ filebeat:
server: 127.0.0.1:5044
tls:
enabled: True
# set to true to use your own certificate authority
# defaults to False and uses the system CAs
use_custom_ca: True
# this is the public key from your ELK server
# default path is salt://filebeat/files/ca.pem
ssl_cert: salt://mycustom/filebeat/logstash-forwarder.crt
Expand Down