remote_syslog 1.6.6.1 → 1.6.7.pre1
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.md +11 -0
- data/lib/remote_syslog.rb +1 -1
- data/lib/remote_syslog/agent.rb +9 -3
- data/lib/remote_syslog/cli.rb +8 -0
- data/lib/remote_syslog/glob_watch.rb +9 -2
- data/remote_syslog.gemspec +2 -2
- metadata +10 -8
data/README.md
CHANGED
|
@@ -174,6 +174,17 @@ than the current set of matches). This is not necessary for globs defined in
|
|
|
174
174
|
the config file.
|
|
175
175
|
|
|
176
176
|
|
|
177
|
+
### Excluding files from being sent
|
|
178
|
+
|
|
179
|
+
Provide one or more regular expressions to prevent certain files from being
|
|
180
|
+
matched.
|
|
181
|
+
|
|
182
|
+
exclude_files:
|
|
183
|
+
- \.\d$
|
|
184
|
+
- .bz2
|
|
185
|
+
- .gz
|
|
186
|
+
|
|
187
|
+
|
|
177
188
|
### Multiple instances
|
|
178
189
|
|
|
179
190
|
Run multiple instances to support more than one message-specific file format
|
data/lib/remote_syslog.rb
CHANGED
data/lib/remote_syslog/agent.rb
CHANGED
|
@@ -23,11 +23,17 @@ module RemoteSyslog
|
|
|
23
23
|
attr_accessor :facility, :severity, :hostname
|
|
24
24
|
|
|
25
25
|
# Other settings
|
|
26
|
-
attr_accessor :strip_color, :parse_fields
|
|
26
|
+
attr_accessor :strip_color, :parse_fields
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# Exclude messages matching pattern
|
|
29
|
+
attr_accessor :exclude_pattern
|
|
30
|
+
|
|
31
|
+
# Files (can be globs)
|
|
29
32
|
attr_reader :files
|
|
30
33
|
|
|
34
|
+
# Exclude files matching pattern
|
|
35
|
+
attr_accessor :exclude_file_pattern
|
|
36
|
+
|
|
31
37
|
# How often should we check for new files?
|
|
32
38
|
attr_accessor :glob_check_interval
|
|
33
39
|
|
|
@@ -107,7 +113,7 @@ module RemoteSyslog
|
|
|
107
113
|
|
|
108
114
|
files.each do |file|
|
|
109
115
|
RemoteSyslog::GlobWatch.new(file, @glob_check_interval,
|
|
110
|
-
method(:watch_file))
|
|
116
|
+
@exclude_file_pattern, method(:watch_file))
|
|
111
117
|
end
|
|
112
118
|
end
|
|
113
119
|
end
|
data/lib/remote_syslog/cli.rb
CHANGED
|
@@ -217,6 +217,14 @@ module RemoteSyslog
|
|
|
217
217
|
if config['exclude_patterns']
|
|
218
218
|
@agent.exclude_pattern = Regexp.new(config['exclude_patterns'].map { |r| "(#{r})" }.join('|'))
|
|
219
219
|
end
|
|
220
|
+
|
|
221
|
+
if config['exclude_files']
|
|
222
|
+
@agent.exclude_file_pattern = Regexp.new(config['exclude_files'].map { |r| "(#{r})" }.join('|'))
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if config['new_file_check_interval']
|
|
226
|
+
@agent.glob_check_interval = config['new_file_check_interval']
|
|
227
|
+
end
|
|
220
228
|
end
|
|
221
229
|
|
|
222
230
|
def run
|
|
@@ -2,12 +2,19 @@ require 'eventmachine-tail'
|
|
|
2
2
|
|
|
3
3
|
module RemoteSyslog
|
|
4
4
|
class GlobWatch < EventMachine::FileGlobWatch
|
|
5
|
-
def initialize(path, interval, callback)
|
|
6
|
-
|
|
5
|
+
def initialize(path, interval, exclude_files, callback)
|
|
6
|
+
@exclude_files = exclude_files
|
|
7
7
|
@callback = callback
|
|
8
|
+
|
|
9
|
+
super(path, interval)
|
|
8
10
|
end
|
|
9
11
|
|
|
10
12
|
def file_found(path)
|
|
13
|
+
# Check if we should exclude this file
|
|
14
|
+
if @exclude_files && @exclude_files =~ path
|
|
15
|
+
return
|
|
16
|
+
end
|
|
17
|
+
|
|
11
18
|
@callback.call(path)
|
|
12
19
|
end
|
|
13
20
|
|
data/remote_syslog.gemspec
CHANGED
|
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
|
8
8
|
## If your rubyforge_project name is different, then edit it and comment out
|
|
9
9
|
## the sub! line in the Rakefile
|
|
10
10
|
s.name = 'remote_syslog'
|
|
11
|
-
s.version = '1.6.
|
|
12
|
-
s.date = '2012-
|
|
11
|
+
s.version = '1.6.7.pre1'
|
|
12
|
+
s.date = '2012-09-04'
|
|
13
13
|
s.rubyforge_project = 'remote_syslog'
|
|
14
14
|
|
|
15
15
|
## Make sure your summary is short. The description may be as long
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: remote_syslog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
prerelease:
|
|
4
|
+
prerelease: true
|
|
5
5
|
segments:
|
|
6
6
|
- 1
|
|
7
7
|
- 6
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
version: 1.6.
|
|
8
|
+
- 7
|
|
9
|
+
- pre1
|
|
10
|
+
version: 1.6.7.pre1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Troy Davis
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2012-
|
|
19
|
+
date: 2012-09-04 00:00:00 -07:00
|
|
20
20
|
default_executable: remote_syslog
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|
|
@@ -152,11 +152,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
152
152
|
version: "0"
|
|
153
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
requirements:
|
|
155
|
-
- - "
|
|
155
|
+
- - ">"
|
|
156
156
|
- !ruby/object:Gem::Version
|
|
157
157
|
segments:
|
|
158
|
-
-
|
|
159
|
-
|
|
158
|
+
- 1
|
|
159
|
+
- 3
|
|
160
|
+
- 1
|
|
161
|
+
version: 1.3.1
|
|
160
162
|
requirements: []
|
|
161
163
|
|
|
162
164
|
rubyforge_project: remote_syslog
|