Class: LogStash::Modules::FileReader
- Inherits:
-
Object
- Object
- LogStash::Modules::FileReader
- Includes:
- Util::Loggable
- Defined in:
- lib/logstash/modules/file_reader.rb
Class Method Summary collapse
Class Method Details
.glob(path) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/logstash/modules/file_reader.rb', line 27 def self.glob(path) files = Dir.glob(path) if files.empty? logger.warn("No files found for glob", :pattern => path) end files end |
.read(path) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/logstash/modules/file_reader.rb', line 8 def self.read(path) begin ::File.read(path) rescue => e logger.error("Error when reading file from path", :path => path) "" end end |