Filippo Giunchedi has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/335625 )

Change subject: udp2log: mirror traffic from mwlog1001 to fluorine
......................................................................


udp2log: mirror traffic from mwlog1001 to fluorine

Introduce $mirror_destinations to instruct an udp2log host to mirror
traffic to other hosts.

Bug: T123728
Change-Id: I08da3d975aa901a750a96c34a3814cf02b1c12d2
---
M hieradata/hosts/mwlog1001.yaml
M modules/role/manifests/logging/mediawiki/udp2log.pp
M modules/udp2log/manifests/instance.pp
M modules/udp2log/templates/filters.mw.erb
4 files changed, 19 insertions(+), 6 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved



diff --git a/hieradata/hosts/mwlog1001.yaml b/hieradata/hosts/mwlog1001.yaml
index 19e695d..8bd22ca 100644
--- a/hieradata/hosts/mwlog1001.yaml
+++ b/hieradata/hosts/mwlog1001.yaml
@@ -4,3 +4,5 @@
   - mw-log-readers
 role::logging::mediawiki::udp2log::rsync_slow_parse: false
 role::logging::mediawiki::udp2log::forward_messages: false
+role::logging::mediawiki::udp2log::mirror_destinations:
+ - fluorine.eqiad.wmnet
diff --git a/modules/role/manifests/logging/mediawiki/udp2log.pp 
b/modules/role/manifests/logging/mediawiki/udp2log.pp
index ce99ec7..264e681 100644
--- a/modules/role/manifests/logging/mediawiki/udp2log.pp
+++ b/modules/role/manifests/logging/mediawiki/udp2log.pp
@@ -7,6 +7,7 @@
     $rotate = 1000,
     $rsync_slow_parse = false,
     $forward_messages = false,
+    $mirror_destinations = undef,
 ) {
     system::role { 'role::logging:mediawiki::udp2log':
         description => 'MediaWiki log collector',
@@ -59,12 +60,13 @@
     $logstash_port = 8324
 
     udp2log::instance { 'mw':
-        log_directory      =>    $log_directory,
-        monitor_log_age    =>    false,
-        monitor_processes  =>    false,
-        rotate             =>    $rotate,
-        forward_messages   =>    $forward_messages,
-        template_variables => {
+        log_directory       =>   $log_directory,
+        monitor_log_age     =>   false,
+        monitor_processes   =>   false,
+        rotate              =>   $rotate,
+        forward_messages    =>   $forward_messages,
+        mirror_destinations =>   $mirror_destinations,
+        template_variables  => {
             error_processor_host => 'eventlog1001.eqiad.wmnet',
             error_processor_port => 8423,
 
diff --git a/modules/udp2log/manifests/instance.pp 
b/modules/udp2log/manifests/instance.pp
index 05f452b..8d5e651 100644
--- a/modules/udp2log/manifests/instance.pp
+++ b/modules/udp2log/manifests/instance.pp
@@ -35,6 +35,7 @@
     $logrotate_template  = 'udp2log/logrotate_udp2log.erb',
     $rotate              = 1000,
     $forward_messages    = false,
+    $mirror_destinations = undef,
 ){
     # This define requires that the udp2log class has
     # been included.  The udp2log class is parameterized,
diff --git a/modules/udp2log/templates/filters.mw.erb 
b/modules/udp2log/templates/filters.mw.erb
index 17907fb..9da15c0 100644
--- a/modules/udp2log/templates/filters.mw.erb
+++ b/modules/udp2log/templates/filters.mw.erb
@@ -13,3 +13,11 @@
 # not yet directly connected to logstash and should be relayed here.
 pipe 1 egrep '^(scap|scholarships|iegreview) ' | /usr/bin/log2udp -h <%= 
@template_variables['logstash_host'] %> -p <%= 
@template_variables['logstash_port'] %>
 <% end -%>
+
+<% if @mirror_destinations -%>
+
+<% @mirror_destinations.each do |destination| -%>
+pipe 1 /usr/bin/log2udp -h <%= destination %> -p 8420
+<% end -%>
+
+<% end -%>

-- 
To view, visit https://gerrit.wikimedia.org/r/335625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I08da3d975aa901a750a96c34a3814cf02b1c12d2
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Filippo Giunchedi <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to