Skip to content

Instantly share code, notes, and snippets.

@sonots
Created December 15, 2014 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sonots/ae23796829b4e392fdce to your computer and use it in GitHub Desktop.
Save sonots/ae23796829b4e392fdce to your computer and use it in GitHub Desktop.
MultiOutput plugins need to be fixed for v0.12

Problem

Ideally, v0.12 routing should work as follows:

<source>
  type forward
  @label @raw
</source>

<label @raw>
  <match raw.**>
    type copy
    <store>
      type flowcounter
      tag flowcounter
    </store>
  </match>
  # tag match comes inside label
  <match flowcounter>
    type stdout
  </match>
</label>

However, without fix of MultiOutput plugins such as out_copy, or config-expander, v0.12 behaves as follows:

<source>
  type forward
  @label @raw
</source>

<label @raw>
  <match raw.**>
    type config_expander
    <config>
      type flowcounter
      tag flowcounter
    </store>
  </config>
</label>

# flowcounter emits comes here because `router` is root_agent's event_router. 
<match flowcounter>
  type stdout
</match>

How to fix

Authors of following plugins should fix their plugins

https://github.com/search?p=2&q=Plugin.new_output+language%3Aruby&ref=searchresults&type=Code&utf8=%E2%9C%93

as

         output = Plugin.new_output(type)
+        output.router = router if respond_to?(:router) and output.respond_to?(:router=)
         output.configure(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment