fluent-plugin-filter-parse-postfix 0.1.5 → 0.2.0

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: 82e38fcbca9cff3bbca98ae1fb7ac3d99ff2cd44
4
- data.tar.gz: e4541345ef6a5469f2e8b089bbaf194c36e8758c
3
+ metadata.gz: 0f31e5212cec0c75b0e4621949b8d883eeb7d041
4
+ data.tar.gz: 14abeba9a6d7a7e608534bed4d38dee0f9a7724e
5
5
  SHA512:
6
- metadata.gz: 3b3890c9eb6060dd1baf5e9aea924220ac29887beb76fcf97693ec18ee935a06bf03a916ca7ab511453ac2f0b9b68b4dfb8280b24850ba24ff105dc9cd48cee5
7
- data.tar.gz: e53c51e56dc7a7034919f005275972af2c81c21cf2f466f8b12544582fa1b68e59b7d47d1d4536ddd6019d46ef7edb3969fa75248b7ca5eca1ac1dd7d2d9706d
6
+ metadata.gz: dd7a9dfbce95f04fc2ee30f0bcfd317b3f0374f3935034bbc81e5d958d46fc989543ca1d12fdbe57352f5f2d0c0dd067de33974a42462e2d0ea6cbd8f483ea5b
7
+ data.tar.gz: 1b00b9a28858c6a5ff7e2e80460926970a07f7699ec7a3c07a86ed6cfe9d33a4f75b754254a396c97f51bfa227b8e5a5134692ac595157d2deb14ab805bb13e7
data/README.md CHANGED
@@ -28,6 +28,8 @@ Or install it yourself as:
28
28
  #key message
29
29
  #mask true
30
30
  #use_log_time false
31
+ #include_hash false
32
+ #salt my_salt
31
33
  </filter>
32
34
  ```
33
35
 
@@ -51,8 +53,8 @@ $ fluentd -c fluent.conf
51
53
  ```
52
54
 
53
55
  ```sh
54
- $ echo '{"message":"Feb 27 09:02:38 MyHOSTNAME postfix/smtp[26490]: 5E31727A35D: to=<bellsouth@myemail.net>, relay=gateway-f1.isp.att.net[204.127.217.17]:25, delay=0.58, delays=0.11/0.03/0.23/0.20, dsn=2.0.0, status=sent (250 ok ; id=en4req0070M63004172202102)"}' | fluent-cat test.test
55
- #=> 2015-12-22 02:02:22 +0900 test.test: {"time":1424995358,"hostname":"MyHOSTNAME","process":"postfix/smtp[26490]","queue_id":"5E31727A35D","to":"<*********@myemail.net>","domain":"myemail.net","relay":"gateway-f1.isp.att.net[204.127.217.17]:25","delay":0.58,"delays":"0.11/0.03/0.23/0.20","dsn":"2.0.0","status":"sent","status_detail":"(250 ok ; id=en4req0070M63004172202102)"}
56
+ $ echo '{"message":"Feb 27 09:02:38 MyHOSTNAME postfix/smtp[26490]: 5E31727A35D: to=<bellsouth@myemail.net>, relay=gateway-f1.isp.att.net[204.127.217.17]:25, conn_use=2, delay=0.58, delays=0.11/0.03/0.23/0.20, dsn=2.0.0, status=sent (250 ok ; id=en4req0070M63004172202102)"}' | fluent-cat test.test
57
+ #=> 2015-12-22 02:02:22 +0900 test.test: {"time":"Feb 27 09:02:38","hostname":"MyHOSTNAME","process":"postfix/smtp[26490]","queue_id":"5E31727A35D","to":"<*********@myemail.net>","domain":"myemail.net","relay":"gateway-f1.isp.att.net[204.127.217.17]:25","conn_use":2,delay":0.58,"delays":"0.11/0.03/0.23/0.20","dsn":"2.0.0","status":"sent","status_detail":"(250 ok ; id=en4req0070M63004172202102)"}
56
58
  ```
57
59
 
58
60
  ## Output
@@ -65,9 +67,10 @@ see https://github.com/winebarrel/postfix_status_line
65
67
  "hostname":"MyHOSTNAME",
66
68
  "process":"postfix/smtp[26490]",
67
69
  "queue_id":"5E31727A35D",
68
- "to":"<*********@myemail.net>",
70
+ "to":"*********@myemail.net",
69
71
  "domain":"myemail.net",
70
72
  "relay":"gateway-f1.isp.att.net[204.127.217.17]:25",
73
+ "conn_use":2,
71
74
  "delay":0.58,
72
75
  "delays":"0.11/0.03/0.23/0.20",
73
76
  "dsn":"2.0.0",
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_dependency 'fluentd', '>= 0.12'
23
- spec.add_dependency 'postfix_status_line', '>= 0.1.6'
23
+ spec.add_dependency 'postfix_status_line', '~> 0.2.1'
24
24
 
25
25
  spec.add_development_dependency 'bundler'
26
26
  spec.add_development_dependency 'rake'
@@ -9,6 +9,8 @@ module Fluent
9
9
  config_param :key, :string, :default => 'message'
10
10
  config_param :mask, :bool, :default => true
11
11
  config_param :use_log_time, :bool, :default => false
12
+ config_param :include_hash, :bool, :default => false
13
+ config_param :salt, :string, :default => nil
12
14
 
13
15
  def filter_stream(tag, es)
14
16
  result_es = Fluent::MultiEventStream.new
@@ -29,7 +31,7 @@ module Fluent
29
31
  line = record[@key]
30
32
  return unless line
31
33
 
32
- parsed = PostfixStatusLine.parse(line, @mask)
34
+ parsed = PostfixStatusLine.parse(line,mask: @mask, hash: @include_hash, salt: @salt)
33
35
 
34
36
  unless parsed
35
37
  log.warn "Could not parse a postfix log: #{line}"
@@ -1,3 +1,3 @@
1
1
  module FluentPluginFilterParsePostfix
2
- VERSION = '0.1.5'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-filter-parse-postfix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-22 00:00:00.000000000 Z
11
+ date: 2015-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.12'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.12'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: postfix_status_line
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.6
33
+ version: 0.2.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.6
40
+ version: 0.2.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 3.0.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: test-unit
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 3.1.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.1.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: timecop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: Filter Plugin to parse Postfix status line log.
@@ -115,9 +115,9 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - .gitignore
119
- - .rspec
120
- - .travis.yml
118
+ - ".gitignore"
119
+ - ".rspec"
120
+ - ".travis.yml"
121
121
  - Gemfile
122
122
  - LICENSE.txt
123
123
  - README.md
@@ -137,17 +137,17 @@ require_paths:
137
137
  - lib
138
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
139
  requirements:
140
- - - '>='
140
+ - - ">="
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0'
143
143
  required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - '>='
145
+ - - ">="
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  requirements: []
149
149
  rubyforge_project:
150
- rubygems_version: 2.0.14.1
150
+ rubygems_version: 2.4.5.1
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Filter Plugin to parse Postfix status line log.