fluent-plugin-irc 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -20,7 +20,7 @@ Fluent plugin to send messages to IRC server
20
20
  user fluentd
21
21
  real fluentd
22
22
  message notice: %s [%s] %s
23
- out_keys tag,time,msg
23
+ out_keys tag,time,message
24
24
  time_key time
25
25
  time_format %Y/%m/%d %H:%M:%S
26
26
  tag_key tag
@@ -29,23 +29,23 @@ Fluent plugin to send messages to IRC server
29
29
 
30
30
  ### Parameter
31
31
 
32
- |parameter|description|
33
- |---|---|
34
- |host|IRC server host|
35
- |port|IRC server port number|
36
- |channel|channel to send messages (without first '#')|
37
- |nick|nickname registerd of IRC|
38
- |user|user name registerd of IRC|
39
- |real|real name registerd of IRC|
40
- |message|message format. %s will be replaced with value specified by out_keys|
41
- |out_keys|keys used to format messages|
42
- |time_key|key name for time|
43
- |time_format|time format. This will be formatted with Time#strftime.|
44
- |tag_key|key name for tag|
32
+ |parameter|description|default|
33
+ |---|---|---|
34
+ |host|IRC server host|localhost|
35
+ |port|IRC server port number|6667|
36
+ |channel|channel to send messages (without first '#')||
37
+ |nick|nickname registerd of IRC|fluentd|
38
+ |user|user name registerd of IRC|fluentd|
39
+ |real|real name registerd of IRC|fluentd|
40
+ |message|message format. %s will be replaced with value specified by out_keys||
41
+ |out_keys|keys used to format messages||
42
+ |time_key|key name for time|time|
43
+ |time_format|time format. This will be formatted with Time#strftime.|%Y/%m/%d %H:%M:%S|
44
+ |tag_key|key name for tag|tag|
45
45
 
46
46
  ## Copyright
47
47
 
48
48
  <table>
49
- <tr><td>Copyright</td><td>Copyright (c) 2012 OKUNO Akihiro</td></tr>
49
+ <tr><td>Copyright</td><td>Copyright (c) 2013 OKUNO Akihiro</td></tr>
50
50
  <tr><td>License</td><td>Apache License, Version 2.0</td></tr>
51
51
  </table>
@@ -10,6 +10,7 @@
10
10
  nick fluentd
11
11
  user fluentd
12
12
  real fluentd
13
+ password pass
13
14
  message notice: %s [%s] %s
14
15
  out_keys tag,time,msg
15
16
  time_key time
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-irc"
6
- s.version = "0.0.2"
6
+ s.version = "0.0.3"
7
7
  s.authors = ["OKUNO Akihiro"]
8
8
  s.email = ["okuno.akihiro@gmail.com"]
9
9
  s.homepage = "https://github.com/choplin/fluent-plugin-irc"
@@ -19,8 +19,8 @@ module Fluent
19
19
  config_param :out_keys do |val|
20
20
  val.split(',')
21
21
  end
22
- config_param :time_key , :string , :default => nil
23
- config_param :time_format , :string , :default => nil
22
+ config_param :time_key , :string , :default => 'time'
23
+ config_param :time_format , :string , :default => '%Y/%m/%d %H:%M:%S'
24
24
  config_param :tag_key , :string , :default => 'tag'
25
25
 
26
26
 
@@ -73,7 +73,15 @@ module Fluent
73
73
 
74
74
  private
75
75
  def build_message(record)
76
- values = @out_keys.map {|key| record[key].to_s}
76
+ values = @out_keys.map do |key|
77
+ begin
78
+ record.fetch(key).to_s
79
+ rescue KeyError
80
+ $log.warn "out_irc: the specified key '#{key}' not found in record"
81
+ ''
82
+ end
83
+ end
84
+
77
85
  @message % values
78
86
  end
79
87
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-irc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-23 00:00:00.000000000 Z
12
+ date: 2013-04-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd