logstash-filter-mautic 0.1 → 0.2

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: 4989fb37b968f02e249a43e4388a620314a98d3b
4
- data.tar.gz: 81ba8474b2407c61c04effb51ebe7779c9b725f5
3
+ metadata.gz: cf52fc4555ba5c933b512bd7ce008879c510ee65
4
+ data.tar.gz: 061af245a1fd8efb0fa4f01b323715d4040c9d10
5
5
  SHA512:
6
- metadata.gz: 82ae3685b774aeb7e4719136aed14ffa4522dde97a8c34ac4ca93dbbc867ba4edb9b759ed92b017618287d7c49b2ff9e7628b0d101399ebddefd4600d52d3aeb
7
- data.tar.gz: 7e4d5beea13e819afada5b0624c060285791c97ae6a5e1bba2ea25d6694ebdda58bb4feff4453bda1527cce6b0ed29d1ea05a84902e1f769b2802bcb53c9d888
6
+ metadata.gz: 875cfc7e091e2a3af3b3c38b2b4968e01303cab7b1a17bdd0f2553ecdacd02797e8cfa8f659619c60049a0cde5c081df1757db491d0805a6347d34a449433d96
7
+ data.tar.gz: 35c9b6aa5a8c1736131101fb78cfbc4d801b24fa8e26aa67e32e4c5fde922d81f3dba6662649a19377de879cbd72c8a644f74b966baa906eb36d1b5107e68c31
data/DEVELOPER.md CHANGED
@@ -1,2 +1,8 @@
1
1
  # logstash-filter-mautic
2
2
  Example filter plugin. This should help bootstrap your effort to write your own filter plugin!
3
+
4
+
5
+ ```
6
+ bundle exec gem build logstash-filter*
7
+ bundle exec gem push logstash-filter-mautic-*
8
+ ```
@@ -235,7 +235,10 @@ class LogStash::Filters::Mautic < LogStash::Filters::Base
235
235
  def processNewUpdateLead(json_data,key)
236
236
  parsed_data = newLeadFilter(json_data)
237
237
  parsed_data['leadid'] = parsed_data['id'].to_i
238
+ parsed_data['emailAddress'] = parsed_data['email']
239
+
238
240
  parsed_data.delete('id')
241
+ parsed_data.delete('email')
239
242
 
240
243
  if parsed_data['dateIdentified'] != nil
241
244
  parsed_data['dateIdentified'] = LogStash::Timestamp.parse_iso8601(parsed_data['dateIdentified'])
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-mautic'
3
- s.version = '0.1'
3
+ s.version = '0.2'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Receives Mautic webhook data to view in Elasticsearch"
6
6
  s.description = "This plugin lets you get the majority of you Mautic data into Elasticsearch for viewing using Kibana. Just setup a http input for logstash and a filter like so mautic { source => 'message'}. See the GitHub repository for more information"
@@ -55,6 +55,8 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Mautic do
55
55
  #insist { subject["points"] } == 25
56
56
  expect(subject).to include('leadid')
57
57
  expect(subject['leadid']).to eq(80)
58
+ expect(subject).not_to include('fields')
59
+
58
60
  end
59
61
  end
60
62
 
@@ -81,6 +83,8 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Mautic do
81
83
  #insist { subject["points"] } == 25
82
84
  expect(subject).to include("firstname")
83
85
  expect(subject['firstname']).to eq("New")
86
+ expect(subject).not_to include('fields')
87
+
84
88
  end
85
89
  end
86
90
 
@@ -110,7 +114,7 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Mautic do
110
114
  expect(subject['mautic_tags'][0]).to eq("test")
111
115
  expect(subject['mautic_tags'][1]).to eq("test2")
112
116
  expect(subject).not_to include('fields')
113
-
117
+ expect(subject).not_to include('fields')
114
118
  end
115
119
  end
116
120
 
@@ -184,6 +188,8 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Mautic do
184
188
  expect(subject['ipAddresses'][0]).to eq("123.14.945.113")
185
189
  expect(subject['ipAddresses'][1]).to eq("89.14.945.55")
186
190
  expect(subject).not_to include('fields')
191
+ expect(subject).not_to include('fields')
192
+
187
193
 
188
194
  end
189
195
  end
@@ -288,6 +294,53 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Mautic do
288
294
  }
289
295
  },
290
296
  "timestamp": "2015-11-12T10:40:19+11:00"
297
+ }'
298
+ #it "should contain points"
299
+ sample entered_fields do
300
+ #insist { subject["points"] } == 25
301
+ expect(subject).to include('leadid')
302
+ expect(subject).not_to include('fields')
303
+ expect(subject).to include('firstname')
304
+ expect(subject['leadid']).to eq(25)
305
+ expect(subject['type']).to eq("lead")
306
+ expect(subject['firstname']).to eq("test")
307
+ expect(subject).not_to include('fields')
308
+
309
+ end
310
+ end
311
+
312
+
313
+ describe "Check changed points" do
314
+ let(:config) do <<-CONFIG
315
+ filter {
316
+ mautic {
317
+ source => "message"
318
+ }
319
+ }
320
+ CONFIG
321
+ end
322
+
323
+ entered_fields = '{
324
+ "mautic.lead_points_change": {
325
+ "lead": {
326
+ "id": 26,
327
+ "points": 10,
328
+ "color": null,
329
+ "fields": {},
330
+ "lastActive": "2015-08-26T01:30:35+00:00",
331
+ "owner": null,
332
+ "ipAddresses": {
333
+ "127.0.0.1": []
334
+ },
335
+ "dateIdentified": "2015-08-26T01:30:35+00:00",
336
+ "preferredProfileImage": null
337
+ },
338
+ "points": {
339
+ "old_points": 0,
340
+ "new_points": 10
341
+ }
342
+ },
343
+ "timestamp": "2015-11-13T15:38:10+11:00"
291
344
  }'
292
345
  #it "should contain points"
293
346
  sample entered_fields do
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-mautic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zac Petterd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-13 00:00:00.000000000 Z
11
+ date: 2015-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: logstash-core
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - '>='
17
18
  - !ruby/object:Gem::Version
@@ -19,10 +20,7 @@ dependencies:
19
20
  - - <
20
21
  - !ruby/object:Gem::Version
21
22
  version: 3.0.0
22
- name: logstash-core
23
- prerelease: false
24
- type: :runtime
25
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - '>='
28
26
  - !ruby/object:Gem::Version
@@ -30,20 +28,22 @@ dependencies:
30
28
  - - <
31
29
  - !ruby/object:Gem::Version
32
30
  version: 3.0.0
31
+ prerelease: false
32
+ type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
- requirement: !ruby/object:Gem::Requirement
34
+ name: logstash-devutils
35
+ version_requirements: !ruby/object:Gem::Requirement
35
36
  requirements:
36
37
  - - '>='
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
- name: logstash-devutils
40
- prerelease: false
41
- type: :development
42
- version_requirements: !ruby/object:Gem::Requirement
40
+ requirement: !ruby/object:Gem::Requirement
43
41
  requirements:
44
42
  - - '>='
45
43
  - !ruby/object:Gem::Version
46
44
  version: '0'
45
+ prerelease: false
46
+ type: :development
47
47
  description: This plugin lets you get the majority of you Mautic data into Elasticsearch for viewing using Kibana. Just setup a http input for logstash and a filter like so mautic { source => 'message'}. See the GitHub repository for more information
48
48
  email: zac@sproutlabs.com.au
49
49
  executables: []