From ad17694713182b3393cefa642cc90d91781b6116 Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Fri, 4 Aug 2017 11:16:07 +0200 Subject: [PATCH 1/3] fixed filter.erb template indentation --- .../files/filter_record_transformer.conf | 8 ++++---- templates/filter.erb | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spec/fixtures/files/filter_record_transformer.conf b/spec/fixtures/files/filter_record_transformer.conf index 58aadb6..6131586 100644 --- a/spec/fixtures/files/filter_record_transformer.conf +++ b/spec/fixtures/files/filter_record_transformer.conf @@ -1,6 +1,6 @@ - type record_transformer - - hostname ${hostname} - + type record_transformer + + hostname ${hostname} + diff --git a/templates/filter.erb b/templates/filter.erb index 830cfdb..289c167 100644 --- a/templates/filter.erb +++ b/templates/filter.erb @@ -1,13 +1,13 @@ > <% @config.each do |key, val| -%> - <%- if val.is_a?( Hash ) -%> - <<%= key -%>> - <%- val.each do |key2, val2| -%> - <%= key2 -%> <%= val2 %> - <%- end -%> - > - <%- else -%> - <%= key -%> <%= val %> - <%- end -%> + <%- if val.is_a?( Hash ) -%> + <<%= key -%>> + <%- val.each do |key2, val2| -%> + <%= key2 -%> <%= val2 %> + <%- end -%> + > + <%- else -%> + <%= key -%> <%= val %> + <%- end -%> <% end -%> From 5f84f04f0fc12fc004610238c94fc2ef5b0860ad Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Fri, 4 Aug 2017 11:16:31 +0200 Subject: [PATCH 2/3] fixed match.erb template indentation --- spec/fixtures/files/match_copy.conf | 22 +++--- spec/fixtures/files/match_secure_forward.conf | 18 ++--- templates/match.erb | 68 +++++++++---------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/spec/fixtures/files/match_copy.conf b/spec/fixtures/files/match_copy.conf index 7a45925..6359617 100644 --- a/spec/fixtures/files/match_copy.conf +++ b/spec/fixtures/files/match_copy.conf @@ -1,13 +1,13 @@ - type copy - - type elasticsearch - logstashformat true - hosts 172.20.10.17:9200 - flush_interval 30s - - - type file - path /tmp/td-agent-debug.log - + type copy + + type elasticsearch + logstashformat true + hosts 172.20.10.17:9200 + flush_interval 30s + + + type file + path /tmp/td-agent-debug.log + diff --git a/spec/fixtures/files/match_secure_forward.conf b/spec/fixtures/files/match_secure_forward.conf index 1218ba0..c843099 100644 --- a/spec/fixtures/files/match_secure_forward.conf +++ b/spec/fixtures/files/match_secure_forward.conf @@ -1,11 +1,11 @@ - flush_interval 30s - type secure_forward - secure yes - shared_key my_shared_key - self_hostname instance.test.com - ca_cert_path /path/to/ca.cert - - host test.server.com - + flush_interval 30s + type secure_forward + secure yes + shared_key my_shared_key + self_hostname instance.test.com + ca_cert_path /path/to/ca.cert + + host test.server.com + diff --git a/templates/match.erb b/templates/match.erb index 25e1a0c..f623894 100644 --- a/templates/match.erb +++ b/templates/match.erb @@ -1,39 +1,39 @@ > <% @config.each do |key, val| -%> - <%- if val.is_a?( Hash ) -%> - <<%= key -%>> - <%- val.each do |key, val| -%> - <%= key -%> <%= val %> - <%- end -%> - > - <%- elsif val.is_a?( Array ) -%> - <%- val.each do |k, v| -%> - <<%= key -%>> - <%- if k.is_a?( Hash ) -%> - <%- k.each do |x, y| -%> - <%- if y.is_a?( Array ) -%> - <%- y.each do |a, b| -%> - <<%= x -%>> - <%- if a.is_a?( Hash ) -%> - <%- a.each do |c, d| -%> - <%= c -%> <%= d %> - <%- end -%> - <%- else -%> - <%= a -%> <%= b %> - <%- end -%> - > - <%- end -%> - <%- else -%> - <%= x -%> <%= y %> - <%- end -%> - <%- end -%> - <%- else -%> - <%= k -%> <%= v %> - <%- end -%> - > - <%- end -%> - <%- else -%> - <%= key -%> <%= val %> + <%- if val.is_a?( Hash ) -%> + <<%= key -%>> + <%- val.each do |key, val| -%> + <%= key -%> <%= val %> + <%- end -%> + > + <%- elsif val.is_a?( Array ) -%> + <%- val.each do |k, v| -%> + <<%= key -%>> + <%- if k.is_a?( Hash ) -%> + <%- k.each do |x, y| -%> + <%- if y.is_a?( Array ) -%> + <%- y.each do |a, b| -%> + <<%= x -%>> + <%- if a.is_a?( Hash ) -%> + <%- a.each do |c, d| -%> + <%= c -%> <%= d %> + <%- end -%> + <%- else -%> + <%= a -%> <%= b %> + <%- end -%> + > <%- end -%> + <%- else -%> + <%= x -%> <%= y %> + <%- end -%> + <%- end -%> + <%- else -%> + <%= k -%> <%= v %> + <%- end -%> + > + <%- end -%> + <%- else -%> + <%= key -%> <%= val %> + <%- end -%> <% end -%> From 3e3de2aed95a4ba0f4ba8886716419890707c3fd Mon Sep 17 00:00:00 2001 From: Max Wilhelm Date: Fri, 4 Aug 2017 11:16:51 +0200 Subject: [PATCH 3/3] fixed source.erb template indentation --- spec/fixtures/files/source_tail.conf | 8 ++++---- templates/source.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/fixtures/files/source_tail.conf b/spec/fixtures/files/source_tail.conf index 15b5dad..4eb4061 100644 --- a/spec/fixtures/files/source_tail.conf +++ b/spec/fixtures/files/source_tail.conf @@ -1,6 +1,6 @@ - type tail - format json - path /var/log/test-application/*.json - tag application.test + type tail + format json + path /var/log/test-application/*.json + tag application.test diff --git a/templates/source.erb b/templates/source.erb index 503c9f9..04f119a 100644 --- a/templates/source.erb +++ b/templates/source.erb @@ -1,5 +1,5 @@ <% @config.each do |key, val| -%> - <%= key -%> <%= val %> + <%= key -%> <%= val %> <% end -%>