Class: LogStash::Modules::ElasticsearchImporter
- Inherits:
-
Object
- Object
- LogStash::Modules::ElasticsearchImporter
- Includes:
- Util::Loggable
- Defined in:
- lib/logstash/modules/elasticsearch_importer.rb
Instance Method Summary collapse
-
#initialize(client) ⇒ ElasticsearchImporter
constructor
A new instance of ElasticsearchImporter.
- #put(resource, overwrite = true) ⇒ Object
Constructor Details
#initialize(client) ⇒ ElasticsearchImporter
Returns a new instance of ElasticsearchImporter.
5 6 7 |
# File 'lib/logstash/modules/elasticsearch_importer.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#put(resource, overwrite = true) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/logstash/modules/elasticsearch_importer.rb', line 9 def put(resource, overwrite = true) path = resource.import_path logger.debug("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 |