+template "/etc/cron.daily/expire-logstash" do
+ source "expire.erb"
+ owner "root"
+ group "root"
+ mode "755"
+end
+
+forwarders = []
+
+search(:node, "recipes:logstash\\:\\:forwarder").each do |forwarder|
+ forwarders.append(forwarder.ipaddresses(:role => :external))
+end
+
+search(:node, "roles:gateway").each do |forwarder|
+ forwarders.append(forwarder.ipaddresses(:role => :external))
+end