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.
7 8 9 |
# File 'lib/logstash/modules/kibana_base.rb', line 7 def initialize(import_path, content) @import_path, @content = import_path, content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/logstash/modules/kibana_base.rb', line 5 def content @content end |
#import_path ⇒ Object (readonly)
Returns the value of attribute import_path.
5 6 7 |
# File 'lib/logstash/modules/kibana_base.rb', line 5 def import_path @import_path end |
Instance Method Details
#content_as_object ⇒ Object
19 20 21 22 |
# File 'lib/logstash/modules/kibana_base.rb', line 19 def content_as_object return content unless content.is_a?(String) LogStash::Json.load(content) rescue nil end |
#import(client) ⇒ Object
11 12 13 |
# File 'lib/logstash/modules/kibana_base.rb', line 11 def import(client) raise NotImplementedError, "#{self.class.name} needs to implement `#import`" end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/logstash/modules/kibana_base.rb', line 15 def to_s import_path end |