Skip to content

Commit

Permalink
Merge pull request #7 from redBorder/development
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
jsotofernandez authored Sep 30, 2024
2 parents 5aec9de + f10f673 commit b669b73
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
cookbook-rb-exporter CHANGELOG
===============

## 0.2.0

- David Vanhoucke
- [462f9cc] add method to activate the split of the traffic through logstash

## 0.1.0

- David Vanhoucke
Expand Down
2 changes: 1 addition & 1 deletion resources/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
maintainer_email 'git@redborder.com'
license 'AGPL-3.0'
description 'Installs/Configures cookbook-rb-exporter'
version '0.1.0'
version '0.2.0'
3 changes: 2 additions & 1 deletion resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
action :add do
begin
user = new_resource.user
split_traffic_logstash = new_resource.split_traffic_logstash
config_dir = new_resource.config_dir
arp_ifaces = []

Expand Down Expand Up @@ -116,7 +117,7 @@
cookbook 'rb-exporter'
mode '0644'
retries 2
variables(observation_id: observation_id, observation_id_filters: observation_id_filters)
variables(observation_id: observation_id, observation_id_filters: observation_id_filters, split_traffic_logstash: split_traffic_logstash)
notifies :run, "execute[restart_rb-exporter_#{iface_key}]", :delayed
end
else
Expand Down
1 change: 1 addition & 0 deletions resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@

attribute :user, kind_of: String, default: 'rb-exporter'
attribute :config_dir, kind_of: String, default: '/etc/rb-exporter'
attribute :split_traffic_logstash, kind_of: [TrueClass, FalseClass], default: false
2 changes: 2 additions & 0 deletions resources/templates/default/rb-exporter_pretag_map.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
! dst_mac, vlan.

<% if @observation_id %>
<% if !@split_traffic_logstash %>
<% for observation_id_filter in @observation_id_filters %>
set_tag2=<%= observation_id_filter['observation_id'] %> filter='src net <%= observation_id_filter['subnet'] %>'
<% end %>

<% for observation_id_filter in @observation_id_filters %>
set_tag2=<%= observation_id_filter['observation_id'] %> filter='dst net <%= observation_id_filter['subnet'] %>'
<% end %>
<% end %>

set_tag2=<%=@observation_id%>
<% end %>

0 comments on commit b669b73

Please sign in to comment.