Class: LogStash::Inputs::Elasticsearch::ColumnSpec
- Inherits:
-
Object
- Object
- LogStash::Inputs::Elasticsearch::ColumnSpec
- Defined in:
- lib/logstash/inputs/elasticsearch/esql.rb
Overview
Class representing a column specification in the ESQL response The class’s main purpose is to provide a structure for the event key columns is an array with ‘name` and `type` pair (example: `“type”=>“date”`)
Instance Attribute Summary collapse
-
#:name ⇒ String
readonly
The name of the column.
-
#:type ⇒ String
readonly
The type of the column.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #field_reference ⇒ Object
-
#initialize(spec) ⇒ ColumnSpec
constructor
A new instance of ColumnSpec.
Constructor Details
#initialize(spec) ⇒ ColumnSpec
Returns a new instance of ColumnSpec.
137 138 139 140 |
# File 'lib/logstash/inputs/elasticsearch/esql.rb', line 137 def initialize(spec) @name = isolate(spec.fetch('name')) @type = isolate(spec.fetch('type')) end |
Instance Attribute Details
#:name ⇒ String (readonly)
The name of the column
134 135 136 |
# File 'lib/logstash/inputs/elasticsearch/esql.rb', line 134
def :name
@:name
end
|
#:type ⇒ String (readonly)
The type of the column
134 135 136 |
# File 'lib/logstash/inputs/elasticsearch/esql.rb', line 134
def :type
@:type
end
|
#name ⇒ Object (readonly)
Returns the value of attribute name.
135 136 137 |
# File 'lib/logstash/inputs/elasticsearch/esql.rb', line 135 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
135 136 137 |
# File 'lib/logstash/inputs/elasticsearch/esql.rb', line 135 def type @type end |
Instance Method Details
#field_reference ⇒ Object
142 143 144 |
# File 'lib/logstash/inputs/elasticsearch/esql.rb', line 142 def field_reference @_field_reference ||= '[' + name.gsub('.', '][') + ']' end |