fluent-plugin-http-enhanced 0.0.1 → 0.0.2

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.
data/README.rdoc CHANGED
@@ -19,6 +19,9 @@ This plugin enables some advanced features on existing HTTP input plugin
19
19
  </source>
20
20
 
21
21
 
22
+ If your events contain a param named 'time' or 't' (eg. http://host:port/tag?key1=value1&t=123456789), it will be trated as timestamp for the event (Unix epoch time format)
23
+ It also serves /crossdomain.xml so that your flash apps can post events too.
24
+
22
25
  == Copyright
23
26
 
24
27
  Copyright:: Copyright (c) 2011 Abhishek Parolkar
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.description = "Enhanced HTTP input plugin for Fluent event collector"
6
6
  gem.homepage = "https://github.com/parolkar/fluent-plugin-http-enhanced"
7
7
  gem.summary = gem.description
8
- gem.version = "0.0.1"
8
+ gem.version = "0.0.2"
9
9
  gem.authors = ["Abhishek Parolkar"]
10
10
  gem.email = "abhishek@parolkar.com"
11
11
  gem.has_rdoc = false
@@ -11,9 +11,12 @@ module Fluent
11
11
  begin
12
12
  path = path_info[1..-1] # remove /
13
13
  tag = path.split('/').join('.')
14
+ return ["200 OK", {'Content-type'=>'text/xml'}, CROSSDOMAIN_XML]unless tag.downcase.match("crossdomain.xml").nil?
15
+
14
16
  tag = @default_tag if tag == '' && @default_tag != ''
15
17
  record = params
16
18
  time = params['time']
19
+ time ||= params['t']
17
20
  time = time.to_i
18
21
  if time == 0
19
22
  time = Engine.now
@@ -36,5 +39,12 @@ module Fluent
36
39
  super(path_info, params)
37
40
  end
38
41
  end
42
+ CROSSDOMAIN_XML=<<EOF
43
+ <?xml version="1.0"?>
44
+ <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
45
+ <cross-domain-policy>
46
+ <allow-access-from domain="*" />
47
+ </cross-domain-policy>
48
+ EOF
39
49
  end
40
- end
50
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: fluent-plugin-http-enhanced
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Abhishek Parolkar
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-07 00:00:00 Z
13
+ date: 2012-01-31 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fluentd