<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 26, 2016 at 10:13 PM Jerry Lombardo <<a href="mailto:jl4472@columbia.edu">jl4472@columbia.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hey, Thanks for the reply. </div><div><br></div>I'm trying to get the 500 directories (one for each host under the graphite root ) into one directory.  Replace doesn't look to be doing that.  I posted a screen shot of what I am looking at now,  it's cropped but if i could get all of these sorted under a sub dir it would beat digging through the whole list to find what I want<div><br></div><div><br></div><div><a href="https://gyazo.com/1182b05ead2a12dc9ee33273af316b33" target="_blank">https://gyazo.com/1182b05ead2a12dc9ee33273af316b33</a><br></div></div></blockquote><div><br></div><div>It depends on how you want your values structured in this single directory.<br><br></div><div>. Are you using only the SNMP plugin?<br></div><div>. Are you using other collectd plugins?<br><br></div><div>Collectd will send to carbon->whisper->graphite-web.  You will want to replace the values before sending off to carbon.<br><br></div><div>Replace does work, but again, it depends on what name structure you have now and what you want it to be.  The screenshot only shows the top level directory, i.e. the hostnames.  It would be helpful to see the subdirectories under a hostname.<br><br></div><div>The target_replace examples are scarce.  I have a simple setup using the CPU and Interface plugin, with the CSV plugin for output to a local directory.<br><br></div><div>Before:<br>└── localhost<br>         ├── cpu<br>         └── interface-eth0<br><br><br></div><div>I put the following test configuration in place, which replaces my 'localhost' hostname with a different host name, 'all_hosts':<br><br>LoadPlugin match_regex
<br>LoadPlugin target_replace

<br><br><Chain "PreCache"><br>  <Rule "change_hostname"><br>    <Match "regex"><br>     Host "^localhost.*"<br>    </Match><br>    <Target "replace"><br>      Host "\\<localhost" "all_hosts"<br>     </Target><br>    </Rule><br>   Target "write"<br> </Chain><br><br></div><div># This should be default, but putting in for backwards compatibility<br></div><div> <Chain "PostCache"><br> Target "write"<br> </Chain>
<br><br><br></div><div>After:<br>.<br> ├── all_hosts<br> │       ├── cpu<br> │       └── interface-eth0<br> └── localhost<br>          ├── cpu<br>          └── interface-eth0
<br><br></div><div>The idea here is to replace the values before they make it into the global cache.<br><br><br></div><div>Hope that helps.<br><br></div><div>Giovanni<br></div></div></div>