logstash-input-meetup 2.0.4 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95f97a08097526e9a7f9975532f840f0941732de
4
- data.tar.gz: b15962e26992ee7d6ff528efe854ac08af17ea02
3
+ metadata.gz: 5a32a2d4185ee8dd83f72271e5431c263f27619e
4
+ data.tar.gz: 2987221c9a539a01babf3005bd78569e613366b2
5
5
  SHA512:
6
- metadata.gz: 59be0136cdaa7d5ce968c1cd0221db72f8c8de33143e6b7121cf0b03bd7d9164627e9dc2b81bb2d0f44c7b2dc400b90d405a31d22e08abd3a8d25f640ff8faee
7
- data.tar.gz: d86da000abb53206ccbe1731e5f7beb1ca586a8f6d74f1757452b0dbe8842b00888d2dde797e56cdd7d1ae3628433afbcb68ad97e062b0bf7707c31054af3313
6
+ metadata.gz: 283d23d5d7b470c2f46648ee386fb7882af85c72e6bd630741671623d9e826eea26984f63ce39fa778b772c48df2c2c947782e6706265c84006e99c6e7e22d8a
7
+ data.tar.gz: d97b8d31f0a43bb32387e60e935820bd8638cc23bdb90cfa45f84bd1adac400badaaed8b3be276ec0b44107e9b31cd36f3999634c59edef826f12f5b99539eb9
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2015 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Logstash Plugin
2
2
 
3
- [![Build
4
- Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-meetup-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Inputs/job/logstash-plugin-input-meetup-unit/)
3
+ [![Travis Build Status](https://travis-ci.org/logstash-plugins/logstash-input-meetup.svg)](https://travis-ci.org/logstash-plugins/logstash-input-meetup)
5
4
 
6
5
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
7
6
 
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
56
55
  ```
57
56
  - Install plugin
58
57
  ```sh
58
+ # Logstash 2.3 and higher
59
+ bin/logstash-plugin install --no-verify
60
+
61
+ # Prior to Logstash 2.3
59
62
  bin/plugin install --no-verify
63
+
60
64
  ```
61
65
  - Run Logstash with your plugin
62
66
  ```sh
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
74
78
  ```
75
79
  - Install the plugin from the Logstash home
76
80
  ```sh
77
- bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
81
+ # Logstash 2.3 and higher
82
+ bin/logstash-plugin install --no-verify
83
+
84
+ # Prior to Logstash 2.3
85
+ bin/plugin install --no-verify
86
+
78
87
  ```
79
88
  - Start Logstash and proceed to test the plugin
80
89
 
@@ -1,16 +1,10 @@
1
1
  # encoding: utf-8
2
2
  require "logstash/inputs/base"
3
3
  require "logstash/namespace"
4
+ require "logstash/json"
4
5
  require "socket" # for Socket.gethostname
5
6
 
6
- # Run command line tools and capture the whole output as an event.
7
- #
8
- # Notes:
9
- #
10
- # * The `@source` of this event will be the command run.
11
- # * The `@message` of this event will be the entire stdout of the command
12
- # as one event.
13
- #
7
+ # Periodically query meetup.com regarding updates on events for the given meetupkey
14
8
  class LogStash::Inputs::Meetup < LogStash::Inputs::Base
15
9
 
16
10
  config_name "meetup"
@@ -27,7 +21,7 @@ class LogStash::Inputs::Meetup < LogStash::Inputs::Base
27
21
  # Must have one of `urlname`, `venueid`, `groupid`
28
22
  config :groupid, :validate => :string
29
23
 
30
- # Interval to run the command. Value is in seconds.
24
+ # Interval to run the command. Value is in minutes.
31
25
  config :interval, :validate => :number, :required => true
32
26
 
33
27
  # Meetup Key
@@ -64,17 +58,21 @@ class LogStash::Inputs::Meetup < LogStash::Inputs::Base
64
58
 
65
59
  # Pull down the RSS feed using FTW so we can make use of future cache functions
66
60
  response = Faraday.get @url
67
- result = JSON.parse(response.body)
61
+ begin
62
+ result = LogStash::Json.load(response.body)
63
+ rescue LogStash::Json::ParserError
64
+ # silently ignore json parsing errors
65
+ end
68
66
 
69
- result["results"].each do |rawevent|
67
+ result["results"].each do |rawevent|
70
68
  event = LogStash::Event.new(rawevent)
71
69
  # Convert the timestamps into Ruby times
72
- event['created'] = LogStash::Timestamp.at(event['created'] / 1000, (event['created'] % 1000) * 1000)
73
- event['time'] = LogStash::Timestamp.at(event['time'] / 1000, (event['time'] % 1000) * 1000)
74
- event['group']['created'] = LogStash::Timestamp.at(event['group']['created'] / 1000, (event['group']['created'] % 1000) * 1000)
75
- event['updated'] = LogStash::Timestamp.at(event['updated'] / 1000, (event['updated'] % 1000) * 1000)
76
- event['venue']['lonlat'] = [event['venue']['lon'],event['venue']['lat']] if rawevent.has_key?('venue')
77
- event['group']['lonlat'] = [event['group']['group_lon'],event['group']['group_lat']] if rawevent.has_key?('group')
70
+ event.set('created', LogStash::Timestamp.at(event.get('created') / 1000, (event.get('created') % 1000) * 1000))
71
+ event.set('time', LogStash::Timestamp.at(event.get('time') / 1000, (event.get('time') % 1000) * 1000))
72
+ event.set('[group][created]', LogStash::Timestamp.at(event.get('group][created]') / 1000, (event.get('group][created]') % 1000) * 1000))
73
+ event.set('updated', LogStash::Timestamp.at(event.get('updated') / 1000, (event.get('updated') % 1000) * 1000))
74
+ event.set('[venue][lonlat]', [event.get('[venue][lon]'), event.get('[venue][lat]') if rawevent.has_key?('venue'))
75
+ event.set('[group][lonlat]', [event.get('[group][group_lon]',event'[group][group_lat]') if rawevent.has_key?('group'))
78
76
  decorate(event)
79
77
  queue << event
80
78
  end
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-meetup'
4
- s.version = '2.0.4'
4
+ s.version = '3.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Query and pull events from meetup groups."
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"
7
+ s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
8
8
  s.authors = ["Elastic"]
9
9
  s.email = 'jason.kendall@elastic.co'
10
10
  s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
@@ -20,9 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
24
-
25
- s.add_runtime_dependency 'addressable'
23
+ s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
26
24
 
27
25
  s.add_development_dependency 'logstash-devutils'
28
26
  end
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-meetup
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2017-04-28 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.0'
18
+ version: '2.0'
19
19
  name: logstash-core-plugin-api
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,21 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
27
- - !ruby/object:Gem::Dependency
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: '0'
33
- name: addressable
34
- prerelease: false
35
- type: :runtime
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
26
+ version: '2.0'
41
27
  - !ruby/object:Gem::Dependency
42
28
  requirement: !ruby/object:Gem::Requirement
43
29
  requirements:
@@ -52,7 +38,7 @@ dependencies:
52
38
  - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
- 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
41
+ description: This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program
56
42
  email: jason.kendall@elastic.co
57
43
  executables: []
58
44
  extensions: []