Skip to content

Commit

Permalink
Add way to manage three scenearios to tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Sebastián Soto Fernández authored and Juan Sebastián Soto Fernández committed Nov 11, 2024
1 parent 09cfaa0 commit 9f3d8c6
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions resources/templates/default/sflow_tagging.conf.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
filter {

# Default direction
mutate {
add_field => {
"direction" => "upstream"
}
}

if ![tag] or [tag] == 0 {
<% @flow_nodes.select{|s| s[:ipaddress] and s["redborder"] and s["redborder"]["homenets"] and !s["redborder"]["blocked"]}.each do |flow_node| %>
Expand All @@ -19,9 +13,11 @@ filter {
if homenets.any? {|subnet| subnet.include?(event.get('ip_src')) }
if homenets.any? {|subnet| subnet.include?(event.get('ip_dst')) }
event.set('direction', 'internal')
else
event.set('direction', 'downstream')
else
event.set('direction', 'upstream')
end
elsif homenets.any? {|subnet| subnet.include?(event.get('ip_dst')) }
event.set('direction', 'downstream')
end
"
}
Expand Down

0 comments on commit 9f3d8c6

Please sign in to comment.