logstash-output-jira 0.1.4 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: faf67690e62259a7e2c62bce798d45883a0b1a3c
4
- data.tar.gz: b8b5e23d123235f7646f3e1089b5c0b39d859317
3
+ metadata.gz: 94c3fbb99a608d6343b1583eba585363891eff57
4
+ data.tar.gz: ef080baf8e4b7ea13bffd756ad94a3a8b0677b79
5
5
  SHA512:
6
- metadata.gz: 6354be96ef9c8fd961b72aac8f9692f00a4dcf2e38ff7fb801847bcea1914c498bfb6d96f071127b201db6174d3c6d7d5c8737ee5a81fd3413dcb638b08ffc84
7
- data.tar.gz: a487db5a9c4c52fb7c28873cadc02941323b6e676781b6a0b37752ac18ddcf935ff438f4409250bd6ef29b8db15edeb9dd2578e5e0d6411835e57144936bfc7d
6
+ metadata.gz: 60c737d43d4ce470cc073b37dba805796c12064c16ba339f943774d54694afa79628df2361491b5774742a71b77aa8fe3195987c6e20bbbc2e3f23c7321c55e3
7
+ data.tar.gz: 6841ebb63079f7c11ec9b30b492ed77abd7b15188118f6218a5d06b0d0ef35bf5a124a8f2f279d57fac8db45391fd0043892f1898c0fe8f0b5952b153f6a2661
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## 2.0.0
2
+ - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
3
+ instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
4
+ - Dependency on logstash-core update to 2.0
5
+
data/NOTICE.TXT ADDED
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2015 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
data/README.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Logstash Plugin
2
2
 
3
- This is a plugin for [Logstash](https://github.com/elasticsearch/logstash).
3
+ This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
4
 
5
5
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
6
6
 
7
7
  ## Documentation
8
8
 
9
- Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elasticsearch.org/guide/en/logstash/current/).
9
+ Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
10
10
 
11
11
  - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
12
- - For more asciidoc formatting tips, see the excellent reference here https://github.com/elasticsearch/docs#asciidoc-guide
12
+ - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
13
13
 
14
14
  ## Need Help?
15
15
 
16
- Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com mailing list.
16
+ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
17
17
 
18
18
  ## Developing
19
19
 
@@ -83,4 +83,4 @@ Programming is not a required skill. Whatever you've seen about open source and
83
83
 
84
84
  It is more important to the community that you are able to contribute.
85
85
 
86
- For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
86
+ For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
@@ -1,21 +1,63 @@
1
1
  # encoding: utf-8
2
- # Origin https://groups.google.com/forum/#!msg/logstash-users/exgrB4iQ-mw/R34apku5nXsJ
3
- # and https://botbot.me/freenode/logstash/msg/4169496/
4
- # via https://gist.github.com/electrical/4660061e8fff11cdcf37#file-jira-rb
5
-
6
- # Uses jiralicious as the bridge to JIRA
7
- # By Martin Cleaver, Blended Perspectives
8
- # with a lot of help from 'electrical' in #logstash
9
2
 
10
3
  require "logstash/outputs/base"
11
4
  require "logstash/namespace"
12
5
 
13
-
6
+ # This output allows you to use Logstash to parse and structure
7
+ # your logs and ship structured event data to JIRA.
8
+ #
9
+ # Structured event data will be added to the JIRA issue as 'Description' field value.
10
+ #
11
+ # Example JSON-encoded event:
12
+ #
13
+ # {
14
+ # "message": "Hello JIRA!",
15
+ # "@version": "1",
16
+ # "@timestamp": "2015-06-04T10:23:30.279Z",
17
+ # "type": "syslog",
18
+ # "host": "192.168.1.42",
19
+ # "syslog_pri": "11",
20
+ # "syslog_timestamp": "Jun 4 14:23:30",
21
+ # "syslog_host": "myhost",
22
+ # "program": "root",
23
+ # "syslog_severity_code": 3,
24
+ # "syslog_facility_code": 1,
25
+ # "syslog_facility": "user-level",
26
+ # "syslog_severity": "error"
27
+ # }
28
+ #
29
+ # Example JIRA issue created the event above:
14
30
  #
15
- # This is so is most useful so you can use logstash to parse and structure
16
- # your logs and ship structured, json events to JIRA
31
+ # Type: Task
32
+ # Priority: 2 - Major
33
+ # Status: TO DO
34
+ # Resolution: Unresolved
35
+ # Summary: [logstash] Hello JIRA!
36
+ # Description:
37
+ # ---
38
+ # message: Hello JIRA!
39
+ # '@version': '1'
40
+ # '@timestamp': 2015-06-04 10:23:30.279000000 Z
41
+ # type: syslog
42
+ # host: 192.168.1.42
43
+ # syslog_pri: '11'
44
+ # syslog_timestamp: Jun 4 14:23:30
45
+ # syslog_host: myhost
46
+ # program: root
47
+ # syslog_severity_code: 3
48
+ # syslog_facility_code: 1
49
+ # syslog_facility: user-level
50
+ # syslog_severity: error
17
51
  #
18
- # To use this, you'll need to ensure your JIRA instance allows REST calls
52
+ # To use this output you'll need to ensure that your JIRA instance allows REST calls.
53
+ #
54
+ # This output uses `jiralicious` as the bridge to JIRA
55
+ # By Martin Cleaver, Blended Perspectives
56
+ # with a lot of help from 'electrical' in #logstash.
57
+ #
58
+ # Origin <https://groups.google.com/forum/#!msg/logstash-users/exgrB4iQ-mw/R34apku5nXsJ>
59
+ # and <https://botbot.me/freenode/logstash/msg/4169496/>
60
+ # via <https://gist.github.com/electrical/4660061e8fff11cdcf37#file-jira-rb>.
19
61
 
20
62
  class LogStash::Outputs::Jira < LogStash::Outputs::Base
21
63
  config_name "jira"
@@ -36,6 +78,8 @@ class LogStash::Outputs::Jira < LogStash::Outputs::Base
36
78
  config :issuetypeid, :validate => :string, :required => true
37
79
 
38
80
  # JIRA Summary
81
+ #
82
+ # Truncated and appended with '...' if longer than 255 characters.
39
83
  config :summary, :validate => :string, :required => true
40
84
 
41
85
  # JIRA Priority
@@ -72,38 +116,30 @@ class LogStash::Outputs::Jira < LogStash::Outputs::Base
72
116
 
73
117
  public
74
118
  def receive(event)
75
- return unless output?(event)
119
+
76
120
 
77
- if event == LogStash::SHUTDOWN
78
- finished
79
- return
80
- end
121
+ return if event == LogStash::SHUTDOWN
81
122
 
82
123
  Jiralicious.configure do |config|
83
124
  config.username = @username
84
125
  config.password = @password
85
126
  config.uri = @host
86
- config.auth_type = :cookie
127
+ config.auth_type = :basic
87
128
  config.api_version = "latest"
88
129
  end
89
130
 
131
+ # Limit issue summary to 255 characters
132
+ summary = event.sprintf(@summary)
133
+ summary = "#{summary[0,252]}..." if summary.length > 255
90
134
 
91
- issue = Jiralicious::Issue.new
135
+ issue = Jiralicious::Issue.new
92
136
  issue.fields.set_id("project", @projectid) # would have prefered a project key, https://github.com/jstewart/jiralicious/issues/16
93
- issue.fields.set("summary", @summary)
137
+ issue.fields.set("summary", summary)
138
+ issue.fields.set("description", event.sprintf(event.to_hash.to_yaml))
94
139
  issue.fields.set_id("issuetype", @issuetypeid)
95
- issue.fields.set_name("reporter", @reporter)
96
- issue.fields.set_name("assignee", @assignee)
140
+ issue.fields.set_name("reporter", @reporter) if @reporter
141
+ issue.fields.set_name("assignee", @assignee) if @assignee
97
142
  issue.fields.set_id("priority", @priority)
98
- #puts issue.fields.to_yaml
99
143
  issue.save
100
-
101
-
102
-
103
- # if response.is_a?(Net::HTTPSuccess)
104
- # @logger.info("Event send to JIRA OK!")
105
- # else
106
- # @logger.warn("HTTP error", :error => response.error!)
107
- # end
108
144
  end # def receive
109
145
  end # class LogStash::Outputs::Jira
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-output-jira'
4
- s.version = '0.1.4'
4
+ s.version = '2.0.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Create jira tickets based on events"
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.require_paths = ["lib"]
12
12
 
13
13
  # Files
14
- s.files = `git ls-files`.split($\)+::Dir.glob('vendor/*')
14
+ s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
15
15
 
16
16
  # Tests
17
17
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core", '>= 1.4.0', '< 2.0.0'
23
+ s.add_runtime_dependency "logstash-core", ">= 2.0.0.snapshot", "< 3.0.0"
24
24
 
25
25
  s.add_runtime_dependency 'jiralicious', ['0.2.2']
26
26
 
metadata CHANGED
@@ -1,24 +1,24 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-jira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - '>='
17
17
  - !ruby/object:Gem::Version
18
- version: 1.4.0
18
+ version: 2.0.0.snapshot
19
19
  - - <
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.0
21
+ version: 3.0.0
22
22
  name: logstash-core
23
23
  prerelease: false
24
24
  type: :runtime
@@ -26,10 +26,10 @@ dependencies:
26
26
  requirements:
27
27
  - - '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.4.0
29
+ version: 2.0.0.snapshot
30
30
  - - <
31
31
  - !ruby/object:Gem::Version
32
- version: 2.0.0
32
+ version: 3.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
@@ -64,12 +64,12 @@ executables: []
64
64
  extensions: []
65
65
  extra_rdoc_files: []
66
66
  files:
67
- - .gitignore
67
+ - CHANGELOG.md
68
68
  - CONTRIBUTORS
69
69
  - Gemfile
70
70
  - LICENSE
71
+ - NOTICE.TXT
71
72
  - README.md
72
- - Rakefile
73
73
  - lib/logstash/outputs/jira.rb
74
74
  - logstash-output-jira.gemspec
75
75
  - spec/outputs/jira_spec.rb
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubyforge_project:
98
- rubygems_version: 2.1.9
98
+ rubygems_version: 2.4.8
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Create jira tickets based on events
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- Gemfile.lock
3
- .bundle
4
- vendor
data/Rakefile DELETED
@@ -1,7 +0,0 @@
1
- @files=[]
2
-
3
- task :default do
4
- system("rake -T")
5
- end
6
-
7
- require "logstash/devutils/rake"