Drop some tags and field from http_response input plugin by default
result_type - deprecated, see result_code field
result - dynamic tag, is a bad practice in scope of Prometheus
output, see result_code field
status_code - dynamic tag, is a bad practice in scope of Prometheus
output, see http_response_code field
Change-Id: Ife3cda5acce7dde6ca985ffba3335608f6f282ef
diff --git a/telegraf/files/input/http_response.conf b/telegraf/files/input/http_response.conf
index 954698c..40e1744 100644
--- a/telegraf/files/input/http_response.conf
+++ b/telegraf/files/input/http_response.conf
@@ -1,4 +1,20 @@
[[inputs.http_response]]
+{%- set default_fielddrop = ['result_type'] %}
+{%- set fielddrop = values.get('fielddrop', []) %}
+{%- if fielddrop is string %}
+ {%- do values.update({'fielddrop': default_fielddrop + [fielddrop]}) %}
+{%- else %}
+ {%- do values.update({'fielddrop': default_fielddrop + fielddrop}) %}
+{%- endif -%}
+
+{%- set default_tagexclude = ['result', 'status_code'] %}
+{%- set tagexclude = values.get('tagexclude', []) %}
+{%- if tagexclude is string %}
+ {%- do values.update({'tagexclude': default_tagexclude + [tagexclude]}) %}
+{%- else %}
+ {%- do values.update({'tagexclude': default_tagexclude + tagexclude}) %}
+{%- endif -%}
+
{%- include 'telegraf/files/input/_common.conf' %}
{%- for endpoint, parameters in values.iteritems() %}
{%- if parameters.address is defined %}