title: Collectd multiple write_http plugin with rule chain
body: <p>I am trying to setup a collectd configuration that sends metrics to two separate http server endpoints. </p>
  
  <p>My setup has Client (C) with collectd plugin running on it. Of all the metrics it collects, all of the metrics need to be sent to Server (A); and a part of the metrics also need to be sent to Server (B).</p>
  
  <p>Setup:</p>
  
  <p>I am using the following configuration for the write_http plugin:</p>
  
  <pre><code>&lt;Plugin write_http&gt;
      &lt;Node "serverA"&gt;
              URL "http://servera/collectd-post"
              Format "JSON"
              StoreRates false
      &lt;/Node&gt;
      &lt;Node "serverB"&gt;
              URL "http://serverb/collectd-post"
              Format "JSON"
              StoreRates false
      &lt;/Node&gt;
  &lt;/Plugin&gt;
  </code></pre>
  
  <p>Further, to selectively send the metrics, I tried using the following flow control configuration:</p>
  
  <pre><code>  PostCacheChain "bchain"
    &lt;Chain "bchain"&gt;
      &lt;Rule "brule"&gt;
        &lt;Match "regex"&gt;
          Plugin "(load|interface|disk|cpu|memory|df|swap|processes)"
        &lt;/Match&gt;
        &lt;Target "write"&gt;
          Plugin "write_http/serverB"
        &lt;/Target&gt;
        &lt;Target "return"&gt;
        &lt;/Target&gt;
      &lt;/Rule&gt;
       &lt;Target "return"&gt;
       &lt;/Target&gt;
     &lt;/Chain&gt;
  </code></pre>
  
  <p>Per my understanding of the flow control rules, the above configuration should send metrics from plugins (load, interface, disk, cpu, memory, df, swap, and processes) to serverb node of write_http plugin (as part of the "brule" Rule). These matched metrics should also become available for sending to the other node in the http plugin (because of the Target "return" inside the "brule" Rule).</p>
  
  <p>All other metrics should be processed and sent by the other node in the http plugin (because of the Target "return" outside the "brule" Rule).</p>
  
  <p>The problem I am facing is that I cannot get the functionality working the way I want it to work.</p>
  
  <p>Whats working:</p>
  
  <ul>
  <li>ALL metrics duplicated to BOTH server A and server B, if I remove the PostCacheChain configuration. </li>
  <li>Selected metrics sent ONLY to server B, if the PostCacheChain configuration is kept.</li>
  <li>If using another write plugin, ALL metrics sent to that plugin and only SELECTED metrics sent to server B, when using PostCacheChain configuration</li>
  </ul>
  
  <p>Whats not working:</p>
  
  <ul>
  <li>When using the PostCacheChain as listed, NO metrics are sent to server A</li>
  </ul>
  
  <p>Any solutions or suggestions to get the split destination working would be greatly appreciated.</p>
  
  <p>ps: 
  The documentations for write_http plugin and the collectd flow-control both seem to indicate I am correct in my approach. However, to me, it looks like a write_http plugin is processed only once (even when it has multiple nodes) and that once a write plugin is referred in a rule, it will not be processed outside of the rule. </p>