diff --git a/plugins/inputs/httpjson/httpjson.go b/plugins/inputs/httpjson/httpjson.go index 6fe4da1e5..819188754 100644 --- a/plugins/inputs/httpjson/httpjson.go +++ b/plugins/inputs/httpjson/httpjson.go @@ -244,8 +244,14 @@ func (h *HttpJson) sendRequest(serverURL string) (string, float64, error) { } // Create + send request + body := data.Encode() + body_attr := data.Get('__body') + if body_attr != "" { + list := strings.Split(data.Encode(), '=') + body = list[1] + } req, err := http.NewRequest(h.Method, requestURL.String(), - strings.NewReader(data.Encode())) + strings.NewReader(body)) if err != nil { return "", -1, err }