Class: Fluent::Plugin::RouteOutput::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_route.rb

Instance Method Summary collapse

Constructor Details

#initialize(pattern, router, tag_modifier, copy) ⇒ Route

Returns a new instance of Route.



85
86
87
88
89
90
# File 'lib/fluent/plugin/out_route.rb', line 85

def initialize(pattern, router, tag_modifier, copy)
  @router = router
  @pattern = Fluent::MatchPattern.create(pattern)
  @tag_modifier = tag_modifier
  @copy = copy
end

Instance Method Details

#copy?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'lib/fluent/plugin/out_route.rb', line 96

def copy?
  @copy
end

#emit(tag, es) ⇒ Object



100
101
102
103
# File 'lib/fluent/plugin/out_route.rb', line 100

def emit(tag, es)
  tag = @tag_modifier.call(tag)
  @router.emit_stream(tag, es)
end

#match?(tag) ⇒ Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/fluent/plugin/out_route.rb', line 92

def match?(tag)
  @pattern.match(tag)
end