fangli / fluent-plugin-influxdb

A buffered output plugin for fluentd and InfluxDB
MIT License
111 stars 65 forks source link

added the ability to remove a tag prefix #13

Closed williampratt closed 9 years ago

williampratt commented 9 years ago

This allows you to remove the prefix from a tag

fangli commented 9 years ago

Thanks @williampratt . It's doable but I would like to hear @repeatedly 's opinion. Is removing tag prefix a common requirement?

repeatedly commented 9 years ago

In the v0.10, removing tag prefix is popular because fluentd does't have a filter. In the v0.12 or later, we have a filter and modifying tag becomes rare case. Personally speaking, we don't need remove_tag_prefix or similar parameters in almost cases.

But of course, if there are useful cases, we can adopt these parameters.

williampratt commented 9 years ago

The mixpanel plugin that we use implements it. For my specific setup, it's easier to do it as a config option than a filter as the filter would break my routing.

williampratt commented 9 years ago

To elaborate, I prepend the output plugin name to the event name as we have some events headed to influx, some to mixpanel and some to both. Since filters run before the output matches happen, I can no longer match on those, which breaks my routing.

williampratt commented 9 years ago

Also, the code is minimal and it's optional so I don't see much impact here. I greatly appreciate your gem. I'm glad I didn't have to start from scratch. I plan to write a test suite for it and submit that in a pr as well.

repeatedly commented 9 years ago

Hmm... for complex cases, handling tag is useful for now. In the future, I hope label and filter removes tag handling.

williampratt commented 9 years ago

Don't merge until I give the thumbs up. I'm still testing.

williampratt commented 9 years ago

This is working great for us and ready to merge unless you have any issues with it.

repeatedly commented 9 years ago

Thanks for the testing! I will releaes new version later.