[collectd] write_http plugin - dynamic tag

Marc Fournier marc.fournier at camptocamp.com
Tue Nov 1 17:55:29 CET 2016


Not sure if this answers your question, but starting with 5.6, the
following config should allow you to add arbitry key-values to outgoing
metrics:

<Plugin write_http>
  <Node "example">
    URL "http://localhost:4567/collectd-post"
    Format "json"
  </Node>
</Plugin>

PostCacheChain "PostCache"
<Chain "PostCache">
  <Rule "test">
    <Match "regex">
      Plugin "^cpu$"
    </Match>
    <Target "set">
      MetaData "foo" "bar"
    </Target>
  </Rule>
  Target "write"
</Chain>

Running with the config above, values such as this get POSTed by
collectd's write_http plugin:

{"values":[136247],"dstypes":["derive"],"dsnames":["value"],"time":1478019107.077,"interval":1.000,"host":"localhost","plugin":"cpu","plugin_instance":"2","type":"cpu","type_instance":"idle","meta":{"foo":"bar"}},

HTH,
Marc

Shirly Radco <sradco at redhat.com> writes:

> Would really appreciate if you can elaborate how...
>
> Thank you in advance,
>
> Shirly Radco
>
> BI Software Engineer
> Red Hat Israel Ltd.
> 34 Jerusalem Road
> Building A, 4th floor
> Ra'anana, Israel 4350109
>
>
> On Thu, Oct 13, 2016 at 1:36 PM, Aurelien ROUGEMONT <beorn at binaries.fr>
> wrote:
>
>> On 10/13/2016 12:29 PM, Shirly Radco wrote:
>> > Hi,
>> >
>> > Is there an option to dynamically generate the tag in the collectd
>> > write_http plugin?
>> > (Use the record values to add as tag)
>> >
>> > Thank you,
>> >
>> > Shirly Radco
>> >
>> > BI Software Engineer Red Hat Israel Ltd. 34 Jerusalem Road Building A,
>> > 4th floor Ra'anana, Israel 4350109
>> >
>> >
>> >
>> > _______________________________________________
>> > collectd mailing list
>> > collectd at verplant.org
>> > https://mailman.verplant.org/listinfo/collectd
>> >
>> Hello Shirly,
>>
>> I've done just that in the kairosdb format for write_http
>>
>> Aurelien
>>
>> --
>> Aurelien ROUGEMONT
>> beorn at binaries.fr
>>
>>
>> _______________________________________________
>> collectd mailing list
>> collectd at verplant.org
>> https://mailman.verplant.org/listinfo/collectd
>>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> https://mailman.verplant.org/listinfo/collectd



More information about the collectd mailing list