fluent-plugin-mixpanel-enchanced 0.0.10 → 0.0.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49c6d91faa207ba34712b80cc02a699dbccb1b96
|
4
|
+
data.tar.gz: e4b94470d3e2120645593500e351f6c8b992c72a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83222bdcfe2d677d8904951e166b59701314d3983c55bb3c5e4b6847339ddeeeaaa8941968dba765259e85e229295762a6f5455d28479e2c2a3c2f82890e8b76
|
7
|
+
data.tar.gz: 0bda053d8b3b4d9c71cef0073802a39ed76df4254bc0456100b05f9b32864a06792d70135fab1c9dd4a83a4a39b1e40a0c03d34bcaefa75afc56bd6691ab82dc
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-mixpanel-enchanced"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.11"
|
8
8
|
spec.authors = ["zhron4x"]
|
9
9
|
spec.email = ["zhr0n4x@gmail.com"]
|
10
10
|
spec.summary = %q{Fluentd plugin to input/output event track data to mixpanel}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'fluent/plugin/in_http'
|
2
2
|
require 'base64'
|
3
|
-
require 'pry'
|
4
3
|
|
5
4
|
class Fluent::HttpMixpanelInput < Fluent::HttpInput
|
6
5
|
Fluent::Plugin.register_input('http_mixpanel', self)
|
@@ -10,9 +9,9 @@ class Fluent::HttpMixpanelInput < Fluent::HttpInput
|
|
10
9
|
def on_request(path_info, params)
|
11
10
|
data = Base64.decode64(params['data']).force_encoding('utf-8')
|
12
11
|
json = JSON.parse(data)
|
13
|
-
|
12
|
+
domain = params['HTTP_ORIGIN'].sub('://', '_')
|
14
13
|
props = json['properties']
|
15
|
-
path = "/#{tag_prefix}.#{json['event']}"
|
14
|
+
path = "/#{tag_prefix}.#{domain}.#{json['event']}"
|
16
15
|
params['json'] = props.to_json
|
17
16
|
params['time'] = props['time'].to_s if props['time']
|
18
17
|
|