logstash-filter-mautic 0.2 → 0.3

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: cf52fc4555ba5c933b512bd7ce008879c510ee65
4
- data.tar.gz: 061af245a1fd8efb0fa4f01b323715d4040c9d10
3
+ metadata.gz: e22f6b0119696c34a91fe1ad9799956ebfdcc98f
4
+ data.tar.gz: d2b236234b33dc287fd6dd4c84cb88121da4f1e0
5
5
  SHA512:
6
- metadata.gz: 875cfc7e091e2a3af3b3c38b2b4968e01303cab7b1a17bdd0f2553ecdacd02797e8cfa8f659619c60049a0cde5c081df1757db491d0805a6347d34a449433d96
7
- data.tar.gz: 35c9b6aa5a8c1736131101fb78cfbc4d801b24fa8e26aa67e32e4c5fde922d81f3dba6662649a19377de879cbd72c8a644f74b966baa906eb36d1b5107e68c31
6
+ metadata.gz: 4eab5017be63251e07da1ac6757a1f18881b216d003248520bb5addf1cf2d8957f7a6d9f00f26de5c73b2ea998e5876075ab6103d2622a5e35272687ed42e7f1
7
+ data.tar.gz: ed3e27b691a67d1f034e97eed34bb7d1a220d05002c47d74ac7f1aaa51e3d4f26c6fd2d70511a74281281a7b120987c5cfaa1729f022814826c651c01683d964
@@ -258,6 +258,17 @@ class LogStash::Filters::Mautic < LogStash::Filters::Base
258
258
 
259
259
  def processEmail(json_data)
260
260
  parsed_data = json_data['stat']
261
+
262
+ if parsed_data.include?('lead') == nil
263
+ puts json_data.to_json
264
+ raise "Error no lead object " + json_data.to_json
265
+ end
266
+
267
+ if parsed_data['lead'].include?('id') == nil
268
+ puts json_data.to_json
269
+ raise "Error no lead id " + json_data.to_json
270
+ end
271
+
261
272
  parsed_data['leadid'] = parsed_data['lead']['id'].to_i
262
273
  parsed_data['emailopenid'] = parsed_data['id']
263
274
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-mautic'
3
- s.version = '0.2'
3
+ s.version = '0.3'
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"
@@ -347,10 +347,8 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Mautic do
347
347
  #insist { subject["points"] } == 25
348
348
  expect(subject).to include('leadid')
349
349
  expect(subject).not_to include('fields')
350
- expect(subject).to include('firstname')
351
- expect(subject['leadid']).to eq(25)
350
+ expect(subject['leadid']).to eq(26)
352
351
  expect(subject['type']).to eq("lead")
353
- expect(subject['firstname']).to eq("test")
354
352
  end
355
353
  end
356
354
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-mautic
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
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-12-20 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core