Class: LogStash::Modules::Importer
- Inherits:
-
Object
- Object
- LogStash::Modules::Importer
- Includes:
- Util::Loggable
- Defined in:
- lib/logstash/modules/importer.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ Importer
constructor
A new instance of Importer.
- #put(resource, overwrite = true) ⇒ Object
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
#initialize(client) ⇒ Importer
Returns a new instance of Importer.
8 9 10 |
# File 'lib/logstash/modules/importer.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#put(resource, overwrite = true) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/logstash/modules/importer.rb', line 12 def put(resource, overwrite = true) path = resource.import_path logger.info("Attempting PUT", :url_path => path, :file_path => resource.content_path) if !overwrite && content_exists?(path) logger.debug("Found existing Elasticsearch resource.", :resource => path) return end put_overwrite(path, resource.content) end |