-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f2b98c
commit f4fefd0
Showing
3 changed files
with
47 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
require 'fluent/plugin/filter' | ||
require_relative 'flowcounter_simple' | ||
|
||
class Fluent::FlowCounterSimpleFilter < Fluent::Filter | ||
Fluent::Plugin.register_filter('flowcounter_simple', self) | ||
module Fluent::Plugin | ||
class FlowCounterSimpleFilter < Filter | ||
Fluent::Plugin.register_filter('flowcounter_simple', self) | ||
|
||
include ::Fluent::FlowcounterSimple | ||
include ::Fluent::FlowcounterSimple | ||
|
||
def filter_stream(tag, es) | ||
process(tag, es) | ||
es | ||
def filter_stream(tag, es) | ||
process_count(tag, es) | ||
es | ||
end | ||
end | ||
end if defined?(Fluent::Filter) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
require 'fluent/plugin/output' | ||
require_relative 'flowcounter_simple' | ||
|
||
class Fluent::FlowCounterSimpleOutput < Fluent::Output | ||
Fluent::Plugin.register_output('flowcounter_simple', self) | ||
module Fluent::Plugin | ||
class FlowCounterSimpleOutput < Output | ||
Fluent::Plugin.register_output('flowcounter_simple', self) | ||
|
||
# To support log_level option implemented by Fluentd v0.10.43 | ||
unless method_defined?(:log) | ||
define_method("log") { $log } | ||
end | ||
include ::Fluent::FlowcounterSimple | ||
|
||
def prefer_buffered_processing | ||
false | ||
end | ||
|
||
include ::Fluent::FlowcounterSimple | ||
def multi_workers_ready? | ||
true | ||
end | ||
|
||
def emit(tag, es, chain) | ||
process(tag, es) | ||
chain.next | ||
def process(tag, es) | ||
process_count(tag, es) | ||
end | ||
end | ||
end |