logstash-input-meetup 3.0.4 → 3.1.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/CONTRIBUTORS +2 -0
- data/docs/index.asciidoc +24 -15
- data/lib/logstash/inputs/meetup.rb +36 -16
- data/logstash-input-meetup.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f6ab92cf304bd94da5ef0bb206faf9ddc21084174aa2a8a997b4269e7487d86
|
4
|
+
data.tar.gz: d039428b1d05c3c458ee2ed264f3132a60eb5948d7c4ba9bfc8118cb7564a885
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0391c930d88fee52f976beac1eec5b9e4db16f0c3dbbde08fd1eacfab01c5b58766b5200664add5ea0ce5026570f1751c9d6cefcee8503f93f92f8d4146b02f
|
7
|
+
data.tar.gz: 51846ba01c949db6e1985b3e30e59f6bc1278df2a546a56044e9818aea1f182a884b081f5b6179867fff2f2fcf9c2b550b613454fc910dc7c92f34a66e11dea0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 3.1.0
|
2
|
+
- Add support for text search (siobahnv) [#13](https://github.com/logstash-plugins/logstash-input-meetup/pull/13)
|
3
|
+
|
1
4
|
## 3.0.4
|
2
5
|
- Fix syntax errors (tylerjl) [#11](https://github.com/logstash-plugins/logstash-input-meetup/pull/11)
|
3
6
|
- Minor logging and validation updates
|
data/CONTRIBUTORS
CHANGED
@@ -5,6 +5,8 @@ Contributors:
|
|
5
5
|
* Jason Kendall (coolacid)
|
6
6
|
* Pier-Hugues Pellerin (ph)
|
7
7
|
* Suyog Rao (suyograo)
|
8
|
+
* tylerjl
|
9
|
+
* siobahnv
|
8
10
|
|
9
11
|
Note: If you've sent us patches, bug reports, or otherwise contributed to
|
10
12
|
Logstash, and you aren't on the list above and want to be, please let us know
|
data/docs/index.asciidoc
CHANGED
@@ -20,7 +20,7 @@ include::{include_path}/plugin_header.asciidoc[]
|
|
20
20
|
|
21
21
|
==== Description
|
22
22
|
|
23
|
-
Periodically query meetup.com regarding updates on events for the given
|
23
|
+
Periodically query meetup.com regarding updates on events for the given Meetup key.
|
24
24
|
|
25
25
|
[id="plugins-{type}s-{plugin}-options"]
|
26
26
|
==== Meetup Input Configuration Options
|
@@ -36,6 +36,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
|
|
36
36
|
| <<plugins-{type}s-{plugin}-meetupkey>> |<<string,string>>|Yes
|
37
37
|
| <<plugins-{type}s-{plugin}-urlname>> |<<string,string>>|No
|
38
38
|
| <<plugins-{type}s-{plugin}-venueid>> |<<string,string>>|No
|
39
|
+
| <<plugins-{type}s-{plugin}-text>> |<<string,string>>|No
|
39
40
|
|=======================================================================
|
40
41
|
|
41
42
|
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
@@ -46,25 +47,25 @@ input plugins.
|
|
46
47
|
[id="plugins-{type}s-{plugin}-eventstatus"]
|
47
48
|
===== `eventstatus`
|
48
49
|
|
49
|
-
* Value type is <<string,string
|
50
|
-
* Default value is `"upcoming,past"
|
50
|
+
* Value type is <<string,string>>.
|
51
|
+
* Default value is `"upcoming,past"`.
|
51
52
|
|
52
|
-
Event Status
|
53
|
+
Event Status can be one of `"upcoming"`, `"past"`, or `"upcoming,past"`. Default is `"upcoming,past"`.
|
53
54
|
|
54
55
|
[id="plugins-{type}s-{plugin}-groupid"]
|
55
56
|
===== `groupid`
|
56
57
|
|
57
|
-
* Value type is <<string,string
|
58
|
+
* Value type is <<string,string>>.
|
58
59
|
* There is no default value for this setting.
|
59
60
|
|
60
|
-
The Group ID, multiple may be specified seperated by commas
|
61
|
-
Must have one of `urlname`, `venueid`, `groupid`
|
61
|
+
The Group ID, multiple may be specified seperated by commas.
|
62
|
+
Must have one of `urlname`, `venueid`, `groupid`, `text`.
|
62
63
|
|
63
64
|
[id="plugins-{type}s-{plugin}-interval"]
|
64
65
|
===== `interval`
|
65
66
|
|
66
67
|
* This is a required setting.
|
67
|
-
* Value type is <<number,number
|
68
|
+
* Value type is <<number,number>>.
|
68
69
|
* There is no default value for this setting.
|
69
70
|
|
70
71
|
Interval to run the command. Value is in minutes.
|
@@ -73,29 +74,37 @@ Interval to run the command. Value is in minutes.
|
|
73
74
|
===== `meetupkey`
|
74
75
|
|
75
76
|
* This is a required setting.
|
76
|
-
* Value type is <<string,string
|
77
|
+
* Value type is <<string,string>>.
|
77
78
|
* There is no default value for this setting.
|
78
79
|
|
79
|
-
Meetup Key
|
80
|
+
Meetup Key, aka personal token.
|
80
81
|
|
81
82
|
[id="plugins-{type}s-{plugin}-urlname"]
|
82
83
|
===== `urlname`
|
83
84
|
|
84
|
-
* Value type is <<string,string
|
85
|
+
* Value type is <<string,string>>.
|
85
86
|
* There is no default value for this setting.
|
86
87
|
|
87
|
-
URLName - the URL name ie `ElasticSearch-Oklahoma-City
|
88
|
-
Must have one of urlname, venue_id, group_id
|
88
|
+
URLName - the URL name ie `ElasticSearch-Oklahoma-City`.
|
89
|
+
Must have one of urlname, venue_id, group_id, `text`.
|
89
90
|
|
90
91
|
[id="plugins-{type}s-{plugin}-venueid"]
|
91
92
|
===== `venueid`
|
92
93
|
|
93
|
-
* Value type is <<string,string
|
94
|
+
* Value type is <<string,string>>.
|
94
95
|
* There is no default value for this setting.
|
95
96
|
|
96
97
|
The venue ID
|
97
|
-
Must have one of `urlname`, `venue_id`, `group_id`
|
98
|
+
Must have one of `urlname`, `venue_id`, `group_id`, `text`.
|
98
99
|
|
100
|
+
[id="plugins-{type}s-{plugin}-text"]
|
101
|
+
===== `text`
|
102
|
+
|
103
|
+
* Value type is <<string,string>>.
|
104
|
+
* There is no default value for this setting.
|
105
|
+
|
106
|
+
A text string to search meetup events by.
|
107
|
+
Must have one of `urlname`, `venue_id`, `group_id`, `text`.
|
99
108
|
|
100
109
|
|
101
110
|
[id="plugins-{type}s-{plugin}-common-options"]
|
@@ -10,17 +10,21 @@ class LogStash::Inputs::Meetup < LogStash::Inputs::Base
|
|
10
10
|
config_name "meetup"
|
11
11
|
|
12
12
|
# URLName - the URL name ie `ElasticSearch-Oklahoma-City`
|
13
|
-
# Must have one of urlname, venue_id, group_id
|
13
|
+
# Must have one of urlname, venue_id, group_id, or text
|
14
14
|
config :urlname, :validate => :string
|
15
15
|
|
16
16
|
# The venue ID
|
17
|
-
# Must have one of `urlname`, `venue_id`, `group_id
|
17
|
+
# Must have one of `urlname`, `venue_id`, `group_id`, or 'text'
|
18
18
|
config :venueid, :validate => :string
|
19
19
|
|
20
20
|
# The Group ID, multiple may be specified seperated by commas
|
21
|
-
# Must have one of `urlname`, `venueid`, `groupid
|
21
|
+
# Must have one of `urlname`, `venueid`, `groupid`, or 'text'
|
22
22
|
config :groupid, :validate => :string
|
23
23
|
|
24
|
+
# A text string, AND_text is set to true
|
25
|
+
# Must have one of urlname, venue_id, group_id, or text
|
26
|
+
config :text, :validate => :string
|
27
|
+
|
24
28
|
# Interval to run the command. Value is in minutes.
|
25
29
|
config :interval, :validate => :number, :required => true
|
26
30
|
|
@@ -33,21 +37,30 @@ class LogStash::Inputs::Meetup < LogStash::Inputs::Base
|
|
33
37
|
public
|
34
38
|
def register
|
35
39
|
require "faraday"
|
36
|
-
|
37
|
-
if
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
addon = "group_urlname=#{ @urlname }"
|
42
|
-
# venue_id
|
43
|
-
elsif venueid
|
44
|
-
addon = "venue_id=#{ @venueid }"
|
40
|
+
|
41
|
+
if text
|
42
|
+
# do this
|
43
|
+
addon = "text=#{ @text }&and_text=true"
|
44
|
+
@url = "https://api.meetup.com/2/open_events.json?key=#{ @meetupkey.value }&#{ addon }"
|
45
45
|
else
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
# group_id
|
47
|
+
if groupid
|
48
|
+
addon = "group_id=#{ @groupid }"
|
49
|
+
# group_urlname
|
50
|
+
elsif urlname
|
51
|
+
addon = "group_urlname=#{ @urlname }"
|
52
|
+
# venue_id
|
53
|
+
elsif venueid
|
54
|
+
addon = "venue_id=#{ @venueid }"
|
55
|
+
else
|
56
|
+
# None Selected, raise an error
|
57
|
+
raise "Configuration error! - Must have one of `urlname`, `venue_id`, or `group_id` defined"
|
58
|
+
addon = ""
|
59
|
+
end
|
60
|
+
|
61
|
+
@url = "https://api.meetup.com/2/events.json?key=#{ @meetupkey.value }&status=#{ @eventstatus }&#{ addon }"
|
49
62
|
end
|
50
|
-
|
63
|
+
|
51
64
|
@logger.info("Registering meetup Input", :url => @url.gsub(@meetupkey.value, "xxxx"), :interval => @interval)
|
52
65
|
end # def register
|
53
66
|
|
@@ -68,6 +81,12 @@ class LogStash::Inputs::Meetup < LogStash::Inputs::Base
|
|
68
81
|
end
|
69
82
|
|
70
83
|
result["results"].each do |rawevent|
|
84
|
+
# handling MU's "relevant" but not matching results
|
85
|
+
if text
|
86
|
+
next if rawevent['description'].nil?
|
87
|
+
next unless rawevent['description'].downcase.include? @text.downcase
|
88
|
+
end
|
89
|
+
|
71
90
|
event = LogStash::Event.new(rawevent)
|
72
91
|
# Convert the timestamps into Ruby times
|
73
92
|
event.set('created', LogStash::Timestamp.at(event.get('created') / 1000, (event.get('created') % 1000) * 1000))
|
@@ -76,6 +95,7 @@ class LogStash::Inputs::Meetup < LogStash::Inputs::Base
|
|
76
95
|
event.set('updated', LogStash::Timestamp.at(event.get('updated') / 1000, (event.get('updated') % 1000) * 1000))
|
77
96
|
event.set('[venue][lonlat]', [event.get('[venue][lon]'), event.get('[venue][lat]')]) if rawevent.has_key?('venue')
|
78
97
|
event.set('[group][lonlat]', [event.get('[group][group_lon]'), event.get('[group][group_lat]')]) if rawevent.has_key?('group')
|
98
|
+
event.set('[rating][average]', event.get('[rating][average]').round) if rawevent.has_key?('rating')
|
79
99
|
decorate(event)
|
80
100
|
queue << event
|
81
101
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-meetup'
|
4
|
-
s.version = '3.0
|
4
|
+
s.version = '3.1.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Captures the output of command line tools as an event"
|
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/logstash-plugin install gemname. This gem is not a stand-alone program"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-meetup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|