Skip to content

Commit

Permalink
Merge pull request #926 from amazeeio/fluentd-improvements
Browse files Browse the repository at this point in the history
newest versions of logstash need some additional configs
  • Loading branch information
Schnitzel committed Feb 28, 2019
2 parents d20f666 + 9f46dd9 commit aebb513
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions lagoon-remote/logs-forwarder-logstash/logstash.conf
Expand Up @@ -8,6 +8,7 @@ input {
}

output {
# stdout { codec => rubydebug }
lumberjack {
codec => json
hosts => "${LOGS_FORWARDER_LOGSTASH_TARGET_HOST}"
Expand Down
1 change: 1 addition & 0 deletions services/logs-db/Dockerfile
Expand Up @@ -8,6 +8,7 @@ RUN bin/elasticsearch-plugin install -b com.floragunn:search-guard-6:6.6.1-24.1
&& sed -i 's/searchguard.audit.type: internal_elasticsearch//' config/elasticsearch.yml \
&& echo "searchguard.roles_mapping_resolution: BOTH" >> config/elasticsearch.yml \
&& echo "xpack.monitoring.collection.enabled: true" >> config/elasticsearch.yml \
&& echo "xpack.monitoring.history.duration: 1d" >> config/elasticsearch.yml \
&& echo "node.attr.box_type: \${BOX_TYPE}" >> config/elasticsearch.yml \
&& chmod +x plugins/search-guard-6/tools/hash.sh

Expand Down
11 changes: 9 additions & 2 deletions services/logs-forwarder/.lagoon.multi.yml
Expand Up @@ -219,20 +219,27 @@ objects:
<label @LAGOON_ELASTICSEARCH>
<match **>
@type elasticsearch
#with_transporter_log true
#@log_level debug
host logs-db
port 9200
templates { "container-logs": "/fluentd/etc/container-logs.json"}
template_overwrite true
target_index_key index_name
index_name container-logs-noproject-%Y.%m
reconnect_on_error true
reload_on_failure true
ssl_version TLSv1_2
request_timeout 60s
slow_flush_log_threshold 90s
<buffer tag,time>
@type file
path /fluentd/buffer/elasticsarch
timekey 3600
timekey_wait 0s
flush_mode interval
flush_interval 1s
chunk_limit_size 256MB
flush_interval 10s
chunk_limit_size 16MB
total_limit_size 15GB
flush_thread_count 8
overflow_action block
Expand Down
11 changes: 9 additions & 2 deletions services/logs-forwarder/.lagoon.single.yml
Expand Up @@ -202,20 +202,27 @@ objects:
<label @LAGOON_ELASTICSEARCH>
<match **>
@type elasticsearch
#with_transporter_log true
#@log_level debug
host logs-db
port 9200
templates { "container-logs": "/fluentd/etc/container-logs.json"}
template_overwrite true
target_index_key index_name
index_name container-logs-noproject-%Y.%m
reconnect_on_error true
reload_on_failure true
ssl_version TLSv1_2
request_timeout 60s
slow_flush_log_threshold 90s
<buffer tag,time>
@type file
path /fluentd/buffer/elasticsarch
timekey 3600
timekey_wait 0s
flush_mode interval
flush_interval 1s
chunk_limit_size 256MB
flush_interval 10s
chunk_limit_size 16MB
total_limit_size 15GB
flush_thread_count 8
overflow_action block
Expand Down
2 changes: 1 addition & 1 deletion services/logs-forwarder/Dockerfile
Expand Up @@ -26,4 +26,4 @@ ENV LOGS_FORWARDER_SHARED_KEY=secret \
LOGS_FORWARDER_PRIVATE_KEY_PASSPHRASE=amazing1

ENTRYPOINT ["/sbin/tini", "--", "/bin/entrypoint.sh"]
CMD ["sh", "-c", "exec fluentd -c /fluentd/etc/${FLUENTD_CONF} -p /fluentd/plugins $FLUENTD_OPT"]
CMD ["sh", "-c", "exec fluentd -c /fluentd/etc/fluent.conf -p /fluentd/plugins $FLUENTD_OPT"]
2 changes: 1 addition & 1 deletion services/logs-forwarder/entrypoint.sh
@@ -1,7 +1,7 @@
#!/bin/sh

# If $FLUENT_FORWARD_EXTERNAL_ENABLED is set, we enable the forward external config
if [ "$LOGS_FORWARDER_EXTERNAL_FLUENTD_ENABLED" ] && [ -f /fluentd/etc/logs-copy-forward-external-fluentd.conf.disabled ]; then
if [ "$LOGS_FORWARDER_EXTERNAL_FLUENTD_ENABLED" == "true" ] && [ -f /fluentd/etc/logs-copy-forward-external-fluentd.conf.disabled ]; then

# check that all env variables are set that we will need.
if [ -z $LOGS_FORWARDER_EXTERNAL_FLUENTD_SHARED_KEY ]; then echo "LOGS_FORWARDER_EXTERNAL_FLUENTD_SHARED_KEY is not set, but needed for FLUENT_FORWARD_EXTERNAL_ENABLED"; exit 1; fi
Expand Down

0 comments on commit aebb513

Please sign in to comment.