Class: LogStash::Modules::KibanaBase
- Inherits:
-
Object
- Object
- LogStash::Modules::KibanaBase
- Defined in:
- lib/logstash/modules/kibana_base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#import_path ⇒ Object
readonly
Returns the value of attribute import_path.
Instance Method Summary collapse
- #content_as_object ⇒ Object
- #import(client) ⇒ Object
-
#initialize(import_path, content) ⇒ KibanaBase
constructor
A new instance of KibanaBase.
- #to_s ⇒ Object
Constructor Details
#initialize(import_path, content) ⇒ KibanaBase
Returns a new instance of KibanaBase.
8 9 10 |
# File 'lib/logstash/modules/kibana_base.rb', line 8 def initialize(import_path, content) @import_path, @content = import_path, content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
6 7 8 |
# File 'lib/logstash/modules/kibana_base.rb', line 6 def content @content end |
#import_path ⇒ Object (readonly)
Returns the value of attribute import_path.
6 7 8 |
# File 'lib/logstash/modules/kibana_base.rb', line 6 def import_path @import_path end |
Instance Method Details
#content_as_object ⇒ Object
20 21 22 23 |
# File 'lib/logstash/modules/kibana_base.rb', line 20 def content_as_object return content unless content.is_a?(String) LogStash::Json.load(content) rescue nil end |
#import(client) ⇒ Object
12 13 14 |
# File 'lib/logstash/modules/kibana_base.rb', line 12 def import(client) raise NotImplementedError, "#{self.class.name} needs to implement `#import`" end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/logstash/modules/kibana_base.rb', line 16 def to_s import_path end |