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.



348
349
350
351
352
353
354
355
# File 'lib/logstash/codecs/cef.rb', line 348

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.



358
359
360
# File 'lib/logstash/codecs/cef.rb', line 358

def ecs_field
  @ecs_field
end

#keyObject (readonly)

Returns the value of attribute key.



357
358
359
# File 'lib/logstash/codecs/cef.rb', line 357

def key
  @key
end

#legacyObject (readonly)

Returns the value of attribute legacy.



359
360
361
# File 'lib/logstash/codecs/cef.rb', line 359

def legacy
  @legacy
end

#nameObject (readonly)

Returns the value of attribute name.



356
357
358
# File 'lib/logstash/codecs/cef.rb', line 356

def name
  @name
end

#normalizeObject (readonly)

Returns the value of attribute normalize.



361
362
363
# File 'lib/logstash/codecs/cef.rb', line 361

def normalize
  @normalize
end

#priorityObject (readonly)

Returns the value of attribute priority.



360
361
362
# File 'lib/logstash/codecs/cef.rb', line 360

def priority
  @priority
end