Class: LogStash::Filters::Elasticsearch::ColumnSpec

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#:nameString (readonly)

The name of the column

Returns:

  • (String)

    the current value of :name



159
160
161
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 159

def :name
  @:name
end

#:typeString (readonly)

The type of the column

Returns:

  • (String)

    the current value of :type



159
160
161
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 159

def :type
  @:type
end

#nameObject (readonly)

Returns the value of attribute name.



160
161
162
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 160

def name
  @name
end

#typeObject (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_referenceObject



167
168
169
# File 'lib/logstash/filters/elasticsearch/esql_executor.rb', line 167

def field_reference
  @_field_reference ||= '[' + name.gsub('.', '][') + ']'
end