Skip to content

Commit

Permalink
Index conditional match in output elasticsearch (#97)
Browse files Browse the repository at this point in the history
Adding a conditional statement to switch the output to different index and/or pipeline basing on a specific filter.
  • Loading branch information
cristianocasella authored and pcfens committed Mar 28, 2017
1 parent c064eac commit e17b449
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions templates/filebeat5.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ output.elasticsearch:
<%- if @filebeat_config['output']['elasticsearch']['pipeline'] != nil -%>
pipeline: "<%= @filebeat_config['output']['elasticsearch']['pipeline'] %>"
<%- end -%>
<%- if @filebeat_config['output']['elasticsearch']['indices'] != nil -%>
indices:
<%- @filebeat_config['output']['elasticsearch']['indices'].each do |indice| -%>
<%- if indice['name'] != nil -%>
- index: "<%= indice['name'] %>"
<%- if indice['pipeline'] != nil -%>
pipeline: "<%= indice['pipeline'] %>"
<%- end -%>
when.contains:
<%= indice['filter'] %>: "<%= indice['pattern'] %>"
<%- end -%>
<%- end -%>
<%- end -%>
<%- if @filebeat_config['output']['elasticsearch']['path'] != nil -%>
path: "<%= @filebeat_config['output']['elasticsearch']['path'] %>"
<%- end -%>
Expand Down

0 comments on commit e17b449

Please sign in to comment.