Skip to content

Commit

Permalink
import template logstash from centos6
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsver committed Apr 30, 2024
1 parent 2c75ce0 commit 65b6bec
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
7 changes: 4 additions & 3 deletions resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
vault_nodes = new_resource.vault_nodes #TODO Deprecated?
device_nodes = new_resource.device_nodes
managers_all = new_resource.managers_all #TODO Deprecated?
namespaces = new_resource.namespaces
namespaces = new_resource.namespaces
memcached_server = new_resource.memcached_server
mac_vendors = new_resource.mac_vendors
mongo_cve_database = new_resource.mongo_cve_database
mongo_port = new_resource.mongo_port
logstash_pipelines = new_resource.logstash_pipelines
is_proxy = is_proxy?
is_manager = is_manager?

Expand Down Expand Up @@ -102,7 +103,7 @@
mode 0644
ignore_failure true
cookbook "logstash"
variables(:is_manager => is_manager, :is_proxy => is_proxy)
variables(:is_manager => is_manager, :is_proxy => is_proxy, :pipelines => logstash_pipelines)
notifies :restart, "service[logstash]", :delayed
end

Expand Down Expand Up @@ -851,7 +852,7 @@
notifies :restart, "service[logstash]", :delayed
end
end

# End of pipelines

#logstash rules
Expand Down
1 change: 1 addition & 0 deletions resources/resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
attribute :mac_vendors, :kind_of => String, :default => "/etc/objects/mac_vendors"
attribute :mongo_cve_database, :kind_of => String, :default => 'cvedb'
attribute :mongo_port, :kind_of => String, :default => '27017'
attribute :logstash_pipelines, :kind_of => Array, :default => []

# EXAMPLES

Expand Down
30 changes: 29 additions & 1 deletion resources/templates/default/pipelines.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,76 @@
#######################################################
# pipelines
<% if @is_manager %>
<% if @pipelines.include?("vault-pipeline") %>
- pipeline.id: vault-pipeline
path.config: "/etc/logstash/pipelines/vault"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("sflow-pipeline") %>
- pipeline.id: sflow-pipeline
path.config: "/etc/logstash/pipelines/sflow"
pipeline.workers: 3
<% end %>
<% if @pipelines.include?("netflow-pipeline") %>
- pipeline.id: netflow-pipeline
path.config: "/etc/logstash/pipelines/netflow"
pipeline.workers: 3
<% end %>
<% if @pipelines.include?("scanner-pipeline") %>
- pipeline.id: scanner-pipeline
path.config: "/etc/logstash/pipelines/scanner"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("location-pipeline") %>
- pipeline.id: location-pipeline
path.config: "/etc/logstash/pipelines/location"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("nmsp-pipeline") %>
- pipeline.id: nmsp-pipeline
path.config: "/etc/logstash/pipelines/nmsp"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("radius-pipeline") %>
- pipeline.id: radius-pipeline
path.config: "/etc/logstash/pipelines/radius"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("meraki-pipeline") %>
- pipeline.id: meraki-pipeline
path.config: "/etc/logstash/pipelines/meraki"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("mobility-pipeline") %>
- pipeline.id: mobility-pipeline
path.config: "/etc/logstash/pipelines/mobility"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("apstate-pipeline") %>
- pipeline.id: apstate-pipeline
path.config: "/etc/logstash/pipelines/apstate"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("rbwindow-pipeline") %>
- pipeline.id: rbwindow-pipeline
path.config: "/etc/logstash/pipelines/rbwindow"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("monitor-pipeline") %>
- pipeline.id: monitor-pipeline
path.config: "/etc/logstash/pipelines/monitor"
pipeline.workers: 1
<% end %>
<% end %>
<% if @is_manager or @is_proxy %>
<% if @pipelines.include?("bulkstats-pipeline") %>
- pipeline.id: bulkstats-pipeline
path.config: "/etc/logstash/pipelines/bulkstats"
pipeline.workers: 1
<% end %>
<% if @pipelines.include?("redfish-pipeline") %>
- pipeline.id: redfish-pipeline
path.config: "/etc/logstash/pipelines/redfish"
pipeline.workers: 1
<% end %>
<% end %>
<% end %>

0 comments on commit 65b6bec

Please sign in to comment.