Class: LogStash::Codecs::CEF::CEFField

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/codecs/cef.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, key: name, ecs_field: name, legacy: nil, priority: 0, normalize: nil) ⇒ CEFField

Returns a new instance of CEFField.

Parameters:

  • name (String)

    : the full CEF name of a field

  • key (String) (defaults to: name)

    (optional): an abbreviated CEF key to use when encoding a value with ‘reverse_mapping => true` when left unspecified, the `key` is the field’s ‘name`.

  • ecs_field (String) (defaults to: name)

    (optional): an ECS-compatible field reference to use, with square-bracket syntax. when left unspecified, the ‘ecs_field` is the field’s ‘name`.

  • legacy (String) (defaults to: nil)

    (optional): a legacy CEF name to support in pass-through. in decoding mode without ECS, field name will be used as-provided. in encoding mode without ECS when provided to ‘fields` and `reverse_mapping => false`, field name will be used as-provided.

  • priority (Integer) (defaults to: 0)

    (optional): when multiple fields resolve to the same ECS field name, the field with the highest ‘prioriry` will be used by the encoder.



400
401
402
403
404
405
406
407
# File 'lib/logstash/codecs/cef.rb', line 400

def initialize(name, key: name, ecs_field: name, legacy:nil, priority:0, normalize:nil)
  @name = name
  @key = key
  @ecs_field = ecs_field
  @legacy = legacy
  @priority = priority
  @normalize = normalize
end

Instance Attribute Details

#ecs_fieldObject (readonly)

Returns the value of attribute ecs_field.



410
411
412
# File 'lib/logstash/codecs/cef.rb', line 410

def ecs_field
  @ecs_field
end

#keyObject (readonly)

Returns the value of attribute key.



409
410
411
# File 'lib/logstash/codecs/cef.rb', line 409

def key
  @key
end

#legacyObject (readonly)

Returns the value of attribute legacy.



411
412
413
# File 'lib/logstash/codecs/cef.rb', line 411

def legacy
  @legacy
end

#nameObject (readonly)

Returns the value of attribute name.



408
409
410
# File 'lib/logstash/codecs/cef.rb', line 408

def name
  @name
end

#normalizeObject (readonly)

Returns the value of attribute normalize.



413
414
415
# File 'lib/logstash/codecs/cef.rb', line 413

def normalize
  @normalize
end

#priorityObject (readonly)

Returns the value of attribute priority.



412
413
414
# File 'lib/logstash/codecs/cef.rb', line 412

def priority
  @priority
end