Class: LogStash::Filters::Elasticsearch::ColumnSpec
- Inherits:
-
Object
- Object
- LogStash::Filters::Elasticsearch::ColumnSpec
- Defined in:
- lib/logstash/filters/elasticsearch/esql_executor.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.
162 163 164 165 |
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 162 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
159 160 161 |
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 159 def :name @:name end |
#:type ⇒ String (readonly)
The type of the column
159 160 161 |
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 159 def :type @:type end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
160 161 162 |
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 160 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
160 161 162 |
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 160 def type @type end |
Instance Method Details
#field_reference ⇒ Object
167 168 169 |
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 167 def field_reference @_field_reference ||= '[' + name.gsub('.', '][') + ']' end |