Skip to content

Commit

Permalink
Merge pull request #83 from redBorder/bugfix/#19815_fix_splitting_tra…
Browse files Browse the repository at this point in the history
…ffic_sflow_pipeline

Bugfix/#19815 fix splitting traffic sflow pipeline
manegron authored Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 7cd2f65 + 940b53d commit 94bcd8f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions resources/templates/default/sflow_tagging.conf.erb
Original file line number Diff line number Diff line change
@@ -49,11 +49,14 @@ filter {

tag2 = event.get('tag2')
observation_tag2 = tag2

<% if proxy_node['interfaces'] && !proxy_node['interfaces'].empty? %>
<% proxy_node['interfaces'].each do |iface_key, _orig_iface| %>
<% unless proxy_node['interfaces'][iface_key]['observation_id_filters'].empty? %>
observation_id_filters = <%= proxy_node['interfaces'][iface_key]['observation_id_filters'].to_s.gsub('"', "'") %>

<% role_name = "rBsensor-#{proxy_node.name.gsub('rbproxy-','')}" %>
<% proxy_role = Chef::Role.load role_name rescue nil %>

<% if proxy_role && proxy_role.override_attributes && proxy_role.override_attributes['redborder'] && proxy_role.override_attributes['redborder']['interfaces'] && !proxy_role.override_attributes['redborder']['interfaces'].empty? %>
<% proxy_role.override_attributes['redborder']['interfaces'].each do |iface_key, _orig_iface| %>
<% unless proxy_role.override_attributes['redborder']['interfaces'][iface_key]['observation_id_filters'].empty? %>
observation_id_filters = <%= proxy_role.override_attributes['redborder']['interfaces'][iface_key]['observation_id_filters'].to_s.gsub('"', "'") %>

observation_id_filters.each do |filter|
subnet = IPAddr.new(filter['subnet'])
@@ -89,4 +92,5 @@ filter {
<% end %>
}
<% end %>
}
}

0 comments on commit 94bcd8f

Please sign in to comment.