|
8 | 8 | <%- end -%>
|
9 | 9 | <%- if @input_type =~ /(tcp|udp)/ -%>
|
10 | 10 | host: <%= @host %>
|
11 |
| - <%- if @max_message_size -%> |
| 11 | + <%- if @ssl.length > 0 -%> |
| 12 | + ssl: |
| 13 | + <%- @ssl.each_pair do |k, v| -%> |
| 14 | + <%= k %>: <%= v %> |
| 15 | + <%- end -%> |
| 16 | + <%- end -%> |
| 17 | + <%- if @max_message_size -%> |
12 | 18 | max_message_size: <%= @max_message_size %>
|
13 |
| - <%- end -%> |
| 19 | + <%- end -%> |
14 | 20 | <%- elsif @input_type == 'docker' -%>
|
15 | 21 | containers:
|
16 | 22 | ids:
|
|
24 | 30 | <%- elsif @input_type == 'syslog' -%>
|
25 | 31 | protocol.<%= @syslog_protocol %>:
|
26 | 32 | host: <%= @syslog_host %>
|
| 33 | + <%- if @ssl.length > 0 -%> |
| 34 | + ssl: |
| 35 | + <%- @ssl.each_pair do |k, v| -%> |
| 36 | + <%= k %>: <%= v %> |
| 37 | + <%- end -%> |
| 38 | + <%- end -%> |
27 | 39 | <%- elsif @input_type == 'journald' -%>
|
28 |
| - <%- if @seek -%> |
| 40 | + <%- if @seek -%> |
29 | 41 | seek: <%= @seek %>
|
30 |
| - <%- end -%> |
31 |
| - <%- if @include_matches.length > 0 -%> |
| 42 | + <%- end -%> |
| 43 | + <%- if @include_matches.length > 0 -%> |
32 | 44 | include_matches:
|
33 |
| - <%- @include_matches.each do |match| -%> |
| 45 | + <%- @include_matches.each do |match| -%> |
34 | 46 | - <%= match %>
|
| 47 | + <%- end -%> |
35 | 48 | <%- end -%>
|
36 |
| - <%- end -%> |
37 | 49 | <%- else -%>
|
38 | 50 | paths:
|
39 |
| - <%- @paths.each do |log_path| -%> |
| 51 | + <%- @paths.each do |log_path| -%> |
40 | 52 | - <%= log_path %>
|
41 |
| - <%- end -%> |
42 |
| - <%- if @encoding -%> |
| 53 | + <%- end -%> |
| 54 | + <%- if @encoding -%> |
43 | 55 | encoding: <%= @encoding %>
|
44 |
| - <%- end -%> |
45 |
| - <%- if @include_lines.length > 0 -%> |
| 56 | + <%- end -%> |
| 57 | + <%- if @include_lines.length > 0 -%> |
46 | 58 | include_lines:
|
47 |
| - <%- @include_lines.each do |include_line| -%> |
| 59 | + <%- @include_lines.each do |include_line| -%> |
48 | 60 | - '<%= include_line %>'
|
| 61 | + <%- end -%> |
49 | 62 | <%- end -%>
|
50 |
| - <%- end -%> |
51 |
| - <%- if @exclude_lines.length > 0 -%> |
| 63 | + <%- if @exclude_lines.length > 0 -%> |
52 | 64 | exclude_lines:
|
53 |
| - <%- @exclude_lines.each do |exclude_line| -%> |
| 65 | + <%- @exclude_lines.each do |exclude_line| -%> |
54 | 66 | - '<%= exclude_line %>'
|
| 67 | + <%- end -%> |
55 | 68 | <%- end -%>
|
56 |
| - <%- end -%> |
57 |
| - <%- if @input_type != 'filestream' -%> |
58 |
| - <%- if @exclude_files.length > 0 -%> |
| 69 | + <%- if @input_type != 'filestream' -%> |
| 70 | + <%- if @exclude_files.length > 0 -%> |
59 | 71 | exclude_files:
|
60 |
| - <%- @exclude_files.each do |exclude_file| -%> |
| 72 | + <%- @exclude_files.each do |exclude_file| -%> |
61 | 73 | - <%= exclude_file %>
|
| 74 | + <%- end -%> |
62 | 75 | <%- end -%>
|
63 | 76 | <%- end -%>
|
64 |
| - <%- end -%> |
65 |
| - <%- if @ignore_older -%> |
| 77 | + <%- if @ignore_older -%> |
66 | 78 | ignore_older: <%= @ignore_older %>
|
67 |
| - <%- end -%> |
68 |
| - <%- if @doc_type -%> |
| 79 | + <%- end -%> |
| 80 | + <%- if @doc_type -%> |
69 | 81 | document_type: <%= @doc_type %>
|
| 82 | + <%- end -%> |
70 | 83 | <%- end -%>
|
71 |
| -<%- if @scan_frequency or @exclude_files -%> |
72 |
| - <%- if @input_type == 'filestream' -%> |
| 84 | + <%- if @scan_frequency or @exclude_files -%> |
| 85 | + <%- if @input_type == 'filestream' -%> |
73 | 86 | prospector:
|
74 | 87 | scanner:
|
75 |
| - <%- if @scan_frequency -%> |
| 88 | + <%- if @scan_frequency -%> |
76 | 89 | check_interval: <%= @scan_frequency %>
|
77 |
| - <%- end -%> |
78 |
| - <%- if @exclude_files.length > 0 -%> |
| 90 | + <%- end -%> |
| 91 | + <%- if @exclude_files.length > 0 -%> |
79 | 92 | exclude_files:
|
80 |
| - <%- @exclude_files.each do |exclude_file| -%> |
| 93 | + <%- @exclude_files.each do |exclude_file| -%> |
81 | 94 | - <%= exclude_file %>
|
82 |
| - <%- end -%> |
83 | 95 | <%- end -%>
|
84 |
| - <%- else -%> |
| 96 | + <%- end -%> |
| 97 | + <%- else -%> |
85 | 98 | scan_frequency: <%= @scan_frequency %>
|
| 99 | + <%- end -%> |
86 | 100 | <%- end -%>
|
87 |
| -<%- end -%> |
88 | 101 | <%- if @harvester_buffer_size -%>
|
89 | 102 | harvester_buffer_size: <%= @harvester_buffer_size %>
|
90 | 103 | <%- end -%>
|
91 |
| -<%- if @max_bytes -%> |
92 |
| - <%- if @input_type == 'filestream' -%> |
| 104 | + <%- if @max_bytes -%> |
| 105 | + <%- if @input_type == 'filestream' -%> |
93 | 106 | message_max_bytes: <%= @max_bytes %>
|
94 |
| - <%- else -%> |
| 107 | + <%- else -%> |
95 | 108 | max_bytes: <%= @max_bytes %>
|
| 109 | + <%- end -%> |
96 | 110 | <%- end -%>
|
97 |
| -<%- end -%> |
98 | 111 | <%- if @symlinks -%>
|
99 | 112 | symlinks: <%= @symlinks %>
|
100 | 113 | <%- end -%>
|
|
104 | 117 | <%- if @force_close_files -%>
|
105 | 118 | force_close_files: <%= @force_close_files %>
|
106 | 119 | <%- end -%>
|
107 |
| - |
108 | 120 | <%- if @json.length > 0 -%>
|
109 |
| - ### JSON configuration |
| 121 | + ###JSON configuration |
110 | 122 | json:
|
111 | 123 | # Decode JSON options. Enable this if your logs are structured in JSON.
|
112 | 124 | # JSON key on which to apply the line filtering and multiline settings. This key
|
113 | 125 | # must be top level and its value must be string, otherwise it is ignored. If
|
114 | 126 | # no text key is defined, the line filtering and multiline features cannot be used.
|
115 |
| - <%- if @json['message_key'] != nil-%> |
| 127 | + <%- if @json['message_key'] != nil -%> |
116 | 128 | message_key: '<%= @json['message_key'] %>'
|
117 | 129 | <%- end -%>
|
118 | 130 |
|
|
136 | 148 | add_error_key: <%= @json['add_error_key'] %>
|
137 | 149 | <%- end -%>
|
138 | 150 | <%- end -%>
|
139 |
| - |
140 |
| -<%- if @multiline.length > 0 -%> |
141 |
| - <%- if @input_type == 'filestream' -%> |
| 151 | + <%- if @multiline.length > 0 -%> |
| 152 | + <%- if @input_type == 'filestream' -%> |
142 | 153 | parsers:
|
143 | 154 | - multiline:
|
144 | 155 | <%- if @multiline['pattern'] -%>
|
|
156 | 167 | <%- if @multiline['timeout'] -%>
|
157 | 168 | timeout: <%= @multiline['timeout'] %>
|
158 | 169 | <%- end -%>
|
159 |
| - <%- else -%> |
| 170 | + <%- else -%> |
160 | 171 | multiline:
|
161 |
| - <%- if @multiline['pattern'] -%> |
| 172 | + <%- if @multiline['pattern'] -%> |
162 | 173 | pattern: '<%= @multiline['pattern'] %>'
|
163 |
| - <%- end -%> |
164 |
| - <%- if @multiline['negate'] -%> |
| 174 | + <%- end -%> |
| 175 | + <%- if @multiline['negate'] -%> |
165 | 176 | negate: <%= @multiline['negate'] %>
|
166 |
| - <%- end -%> |
167 |
| - <%- if @multiline['match'] -%> |
| 177 | + <%- end -%> |
| 178 | + <%- if @multiline['match'] -%> |
168 | 179 | match: <%= @multiline['match'] %>
|
169 |
| - <%- end -%> |
170 |
| - <%- if @multiline['max_lines'] -%> |
| 180 | + <%- end -%> |
| 181 | + <%- if @multiline['max_lines'] -%> |
171 | 182 | max_lines: <%= @multiline['max_lines'] %>
|
172 |
| - <%- end -%> |
173 |
| - <%- if @multiline['timeout'] -%> |
| 183 | + <%- end -%> |
| 184 | + <%- if @multiline['timeout'] -%> |
174 | 185 | timeout: <%= @multiline['timeout'] %>
|
| 186 | + <%- end -%> |
175 | 187 | <%- end -%>
|
176 | 188 | <%- end -%>
|
177 |
| -<%- end -%> |
178 | 189 | tail_files: <%= @tail_files %>
|
179 | 190 |
|
180 | 191 | # Experimental: If symlinks is enabled, symlinks are opened and harvested. The harvester is openening the
|
|
246 | 257 | <%- if @close_timeout -%>
|
247 | 258 | close_timeout: <%= @close_timeout %>
|
248 | 259 | <%- end -%>
|
249 |
| - <%- end -%> |
250 | 260 | <%- # Everything below this can be applied to any input. -%>
|
251 | 261 | <%- # https://www.elastic.co/guide/en/beats/filebeat/current/configuration-general-options.html#configuration-general -%>
|
252 | 262 | <%- if @pipeline -%>
|
|
259 | 269 | <%- end -%>
|
260 | 270 | <%- end -%>
|
261 | 271 | fields_under_root: <%= @fields_under_root %>
|
262 |
| -<%- unless @facts['filebeat_version'] == false -%> |
263 |
| - <%- if scope.function_versioncmp([@facts['filebeat_version'], '7.5']) > 0 -%> |
264 |
| - <%- if @index -%> |
| 272 | + <%- unless @facts['filebeat_version'] == false -%> |
| 273 | + <%- if scope.function_versioncmp([@facts['filebeat_version'], '7.5']) > 0 -%> |
| 274 | + <%- if @index -%> |
265 | 275 | index: <%= @index %>
|
266 |
| - <%- end -%> |
267 |
| - <%- if @keep_null -%> |
| 276 | + <%- end -%> |
| 277 | + <%- if @keep_null -%> |
268 | 278 | keep_null: <%= @keep_null %>
|
269 |
| - <%- end -%> |
270 |
| - <%- end -%> |
271 |
| -<%- end -%> |
272 |
| -<%- if @ssl.length > 0 -%> |
273 |
| - ssl: |
274 |
| - <%- @ssl.each_pair do |k, v| -%> |
275 |
| - <%= k %>: <%= v %> |
| 279 | + <%- end -%> |
276 | 280 | <%- end -%>
|
277 | 281 | <%- end -%>
|
278 | 282 | <%- if @tags.length > 0 -%>
|
|
0 commit comments