Skip to content

Commit

Permalink
Merge pull request #34 from redBorder/bug/#16124_apstate_pipeline
Browse files Browse the repository at this point in the history
add apstate pipeline
  • Loading branch information
malvads authored Jan 19, 2024
2 parents 176ec97 + 6bd86de commit 159cd42
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
38 changes: 37 additions & 1 deletion resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

pipelines = []
if is_manager
pipelines = %w[ sflow netflow vault scanner nmsp location mobility meraki radius rbwindow bulkstats redfish monitor ]
pipelines = %w[ sflow netflow vault scanner nmsp location mobility meraki apstate radius rbwindow bulkstats redfish monitor ]
elsif is_proxy
pipelines = %w[ bulkstats redfish ]
end
Expand Down Expand Up @@ -657,6 +657,42 @@
end
end

#apstate pipeline
if is_manager
template "#{pipelines_dir}/apstate/00_input.conf" do
source "input_kafka.conf.erb"
owner user
group user
mode 0644
ignore_failure true
cookbook "logstash"
variables(:topics => ["rb_state"])
notifies :restart, "service[logstash]", :delayed
end

template "#{pipelines_dir}/apstate/01_apstate.conf" do
source "apstate_apstate.conf.erb"
owner user
group user
mode 0644
ignore_failure true
cookbook "logstash"
notifies :restart, "service[logstash]", :delayed
end

template "#{pipelines_dir}/apstate/99_output.conf" do
source "output_kafka_namespace.conf.erb"
owner user
group user
mode 0644
ignore_failure true
cookbook "logstash"
variables(:output_topic => "rb_state_post",
:namespaces => namespaces)
notifies :restart, "service[logstash]", :delayed
end
end

# Rbwindow pipelines
if is_manager
template "#{pipelines_dir}/rbwindow/00_input.conf" do
Expand Down
7 changes: 7 additions & 0 deletions resources/templates/default/apstate_apstate.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
filter {
apstate {
}
mutate {
remove_field => ["@version","@timestamp"]
}
}
3 changes: 3 additions & 0 deletions resources/templates/default/pipelines.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
- pipeline.id: mobility-pipeline
path.config: "/etc/logstash/pipelines/mobility"
pipeline.workers: 1
- pipeline.id: apstate-pipeline
path.config: "/etc/logstash/pipelines/apstate"
pipeline.workers: 1
- pipeline.id: rbwindow-pipeline
path.config: "/etc/logstash/pipelines/rbwindow"
pipeline.workers: 1
Expand Down

0 comments on commit 159cd42

Please sign in to comment.