Class: Fluent::Plugin::Parser

Inherits:
Base
  • Object
show all
Includes:
OwnedByMixin, TimeMixin::Parser
Defined in:
lib/fluent/plugin/parser.rb

Defined Under Namespace

Classes: ParserError

Constant Summary collapse

TimeParser =
Fluent::TimeParser

Constants included from Configurable

Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary collapse

Attributes inherited from Base

#under_plugin_development

Instance Method Summary collapse

Methods included from TimeMixin::Parser

included, #time_parser_create

Methods included from OwnedByMixin

#log, #owner, #owner=

Methods inherited from Base

#after_shutdown, #after_shutdown?, #after_start, #after_started?, #before_shutdown, #before_shutdown?, #close, #closed?, #configure, #configured?, #has_router?, #inspect, #shutdown, #shutdown?, #start, #started?, #stop, #stopped?, #terminate, #terminated?

Methods included from SystemConfig::Mixin

#system_config, #system_config_override

Methods included from Configurable

#config, #configure, included, lookup_type, register_type

Constructor Details

#initializeParser

Returns a new instance of Parser.



39
40
41
42
# File 'lib/fluent/plugin/parser.rb', line 39

def initialize
  super
  @estimate_current_event = true
end

Instance Attribute Details

#estimate_current_eventObject

SET false BEFORE CONFIGURE, to return nil when time not parsed



35
36
37
# File 'lib/fluent/plugin/parser.rb', line 35

def estimate_current_event
  @estimate_current_event
end

Instance Method Details

#call(*a, &b) ⇒ Object



48
49
50
51
52
# File 'lib/fluent/plugin/parser.rb', line 48

def call(*a, &b)
  # Keep backward compatibility for existing plugins
  # TODO: warn when deprecated
  parse(*a, &b)
end

#parse(text) ⇒ Object

Raises:

  • (NotImplementedError)


44
45
46
# File 'lib/fluent/plugin/parser.rb', line 44

def parse(text)
  raise NotImplementedError, "Implement this method in child class"
end