[MediaWiki-commits] [Gerrit] operations...plugins[master]: Upgrade logstash plugins to 5.5.2

2017-11-27 Thread Gehel (Code Review)
Gehel has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392621 )

Change subject: Upgrade logstash plugins to 5.5.2
..


Upgrade logstash plugins to 5.5.2

- Changed license because ruby complained
- removed sentry to pull it like other plugins (not sure about de dot
  it seems to contain some tweaks event.get vs event.include?)
- install plugins first then prepare offline pack
- added json_encode as it seems to be useful, one usecase I'd like to
  explore is to create a field that contains the event as json that
  could be indexed with the standard analyszer. Perhaps it'd help to
  reduce the need to have dynamic mappings by offering users a free text
  field they could search on to retrieve particular events.

Bug: T178412
Change-Id: I3673cda254731a695b92cce0eb9fff135d52b45a
---
M build.sh
D logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb
M logstash-filters-wikimedia/logstash-filters-wikimedia.gemspec
A target/releases/plugins-5.5.2.zip
M target/releases/plugins-latest.zip
5 files changed, 18 insertions(+), 139 deletions(-)

Approvals:
  Gehel: Verified; Looks good to me, approved



diff --git a/build.sh b/build.sh
index 8e07bb6..f8a6f6e 100755
--- a/build.sh
+++ b/build.sh
@@ -64,11 +64,24 @@
 echo 
 echo Build initial plugin pack with logstash-plugin prepare-offline-pack
 echo
+pushd $LS_HOME # 
https://github.com/logstash-plugins/logstash-filter-anonymize/issues/11
+
+# Install first otherwize prepare-offline-pack will fail
+$LS_PLUGIN install \
+logstash-filter-anonymize \
+logstash-filter-multiline \
+logstash-filter-prune \
+logstash-filter-json_encode \
+logstash-output-sentry
+
 $LS_PLUGIN prepare-offline-pack \
 --output "$PLUGIN_PACK_PATH" \
 logstash-filter-anonymize \
 logstash-filter-multiline \
-logstash-filter-prune
+logstash-filter-prune \
+logstash-filter-json_encode \
+logstash-output-sentry
+popd
 echo
 
 echo 
diff --git a/logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb 
b/logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb
deleted file mode 100644
index 584918b..000
--- a/logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-# from 
https://github.com/antho31/logstash-output-sentry/blob/master/lib/logstash/outputs/sentry.rb
-# (C) 2014 Dave Clark, MIT license
-
-# encoding: utf-8
-require 'logstash/outputs/base'
-require 'logstash/namespace'
-require 'json'
-
-# Sentry is a modern error logging and aggregation platform.
-# * https://getsentry.com/
-#
-# It’s important to note that Sentry should not be thought of as a log stream, 
but as an aggregator. 
-# It fits somewhere in-between a simple metrics solution (such as Graphite) 
and a full-on log stream aggregator (like Logstash).
-#
-# Generate and inform your client key (Settings -> Client key)
-# The client key has this form  * https://[key]:[secret]@[host]/[project_id] *
-#
-# More informations : 
-# * https://sentry.readthedocs.org/en/latest/
-
-
-class LogStash::Outputs::Sentry < LogStash::Outputs::Base
- 
-  config_name 'sentry'
-  
-  
-  # The key of the client key 
-  config :key, :validate => :string, :required => true
-  
-  # The secret  of the client key
-  config :secret, :validate => :string, :required => true
-  
-  # The project id of the client key
-  config :project_id, :validate => :string, :required => true
-  
-  # The Sentry host 
-  config :host, :validate => :string, :default => "https://app.getsentry.com;, 
:required => false 
-  
-  # This sets the message value in Sentry (the title of your event)
-  config :msg, :validate => :string, :default => "Message from logstash", 
:required => false
-  
-  # This sets the level value in Sentry (the level tag)
-  config :level_tag, :validate => :string, :default => "error", :required => 
false
-  
-  # Is the protocole https ? By default yes (host is 
"https://app.getsentry.com;) 
-  # If you have installed Sentry in your own machine, maybe you do use http, 
-  # so you have to disable ssl ( "use_ssl" => false ) 
-  config :use_ssl, :validate => :boolean, :default => true, :required => false 
-  
-  # If set to true automatically map all logstash defined fields to Sentry 
extra fields.
-  # As an example, the logstash event:
-  # [source,ruby]
-  #{
-  #  "@timestamp":"2013-12-10T14:36:26.151+",
-  #  "@version": 1,
-  #  "message":"log message",
-  #  "host": "host.domain.com",
-  #  "nested_field": {
-  #"key": "value"
-  #  }
-  #}
-  # Is mapped to this Sentry  event:
-  # [source,ruby]
-  # extra {
-  #  "@timestamp":"2013-12-10T14:36:26.151+",
-  #  "@version": 1,
-  #  "message":"log message",
-  #  "host": "host.domain.com",
-  #  "nested_field": {
-  #"key": "value"
-  # 

[MediaWiki-commits] [Gerrit] operations...plugins[master]: Upgrade logstash plugins to 5.5.2

2017-11-21 Thread DCausse (Code Review)
DCausse has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392621 )

Change subject: Upgrade logstash plugins to 5.5.2
..

Upgrade logstash plugins to 5.5.2

- Changed license because ruby complained
- removed sentry to pull it like other plugins (not sure about de dot it seems
  to contain some tweaks event.get vs event.include?)
- install plugins first then prepare offline pack

Bug: T178412
Change-Id: I3673cda254731a695b92cce0eb9fff135d52b45a
---
M build.sh
D logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb
M logstash-filters-wikimedia/logstash-filters-wikimedia.gemspec
A target/releases/plugins-5.5.2.zip
M target/releases/plugins-latest.zip
5 files changed, 19 insertions(+), 139 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/operations/software/logstash/plugins 
refs/changes/21/392621/1

diff --git a/build.sh b/build.sh
index 8e07bb6..f88f03c 100755
--- a/build.sh
+++ b/build.sh
@@ -19,6 +19,7 @@
 PLUGIN_PACK_PATH="$(realpath target/releases)/${PLUGIN_PACK}"
 LS_HOME=${LS_HOME:=/usr/share/logstash}
 LS_PLUGIN="${LS_HOME}/bin/logstash-plugin"
+PATH=$PATH:${LS_HOME}/bin
 
 if [ -f "$PLUGIN_PACK_PATH" -a "$IS_SNAPSHOT" = "no" ]; then
 echo Plugin pack already exists, please use a higher version number.
@@ -64,11 +65,24 @@
 echo 
 echo Build initial plugin pack with logstash-plugin prepare-offline-pack
 echo
+pushd $LS_HOME # 
https://github.com/logstash-plugins/logstash-filter-anonymize/issues/11
+
+# Install first otherwize prepare-offline-pack will fail
+$LS_PLUGIN install \
+logstash-filter-anonymize \
+logstash-filter-multiline \
+logstash-filter-prune \
+logstash-filter-json_encode \
+logstash-output-sentry
+
 $LS_PLUGIN prepare-offline-pack \
 --output "$PLUGIN_PACK_PATH" \
 logstash-filter-anonymize \
 logstash-filter-multiline \
-logstash-filter-prune
+logstash-filter-prune \
+logstash-filter-json_encode \
+logstash-output-sentry
+popd
 echo
 
 echo 
diff --git a/logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb 
b/logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb
deleted file mode 100644
index 584918b..000
--- a/logstash-filters-wikimedia/lib/logstash/outputs/sentry.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-# from 
https://github.com/antho31/logstash-output-sentry/blob/master/lib/logstash/outputs/sentry.rb
-# (C) 2014 Dave Clark, MIT license
-
-# encoding: utf-8
-require 'logstash/outputs/base'
-require 'logstash/namespace'
-require 'json'
-
-# Sentry is a modern error logging and aggregation platform.
-# * https://getsentry.com/
-#
-# It’s important to note that Sentry should not be thought of as a log stream, 
but as an aggregator. 
-# It fits somewhere in-between a simple metrics solution (such as Graphite) 
and a full-on log stream aggregator (like Logstash).
-#
-# Generate and inform your client key (Settings -> Client key)
-# The client key has this form  * https://[key]:[secret]@[host]/[project_id] *
-#
-# More informations : 
-# * https://sentry.readthedocs.org/en/latest/
-
-
-class LogStash::Outputs::Sentry < LogStash::Outputs::Base
- 
-  config_name 'sentry'
-  
-  
-  # The key of the client key 
-  config :key, :validate => :string, :required => true
-  
-  # The secret  of the client key
-  config :secret, :validate => :string, :required => true
-  
-  # The project id of the client key
-  config :project_id, :validate => :string, :required => true
-  
-  # The Sentry host 
-  config :host, :validate => :string, :default => "https://app.getsentry.com;, 
:required => false 
-  
-  # This sets the message value in Sentry (the title of your event)
-  config :msg, :validate => :string, :default => "Message from logstash", 
:required => false
-  
-  # This sets the level value in Sentry (the level tag)
-  config :level_tag, :validate => :string, :default => "error", :required => 
false
-  
-  # Is the protocole https ? By default yes (host is 
"https://app.getsentry.com;) 
-  # If you have installed Sentry in your own machine, maybe you do use http, 
-  # so you have to disable ssl ( "use_ssl" => false ) 
-  config :use_ssl, :validate => :boolean, :default => true, :required => false 
-  
-  # If set to true automatically map all logstash defined fields to Sentry 
extra fields.
-  # As an example, the logstash event:
-  # [source,ruby]
-  #{
-  #  "@timestamp":"2013-12-10T14:36:26.151+",
-  #  "@version": 1,
-  #  "message":"log message",
-  #  "host": "host.domain.com",
-  #  "nested_field": {
-  #"key": "value"
-  #  }
-  #}
-  # Is mapped to this Sentry  event:
-  # [source,ruby]
-  # extra {
-  #  "@timestamp":"2013-12-10T14:36:26.151+",
-  #  "@version": 1,
-  #  "message":"log message",
-  #  "host": "host.domain.com",
-  #  "nested_field": {
-  #