Skip to content

Commit

Permalink
Add X-Requested-By header to graylog input (influxdata#5011)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurayops authored and bitcharmer committed Oct 18, 2019
1 parent f178daf commit 7a2faee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/inputs/graylog/graylog.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ func (h *GrayLog) sendRequest(serverURL string) (string, float64, error) {
if err != nil {
return "", -1, fmt.Errorf("Invalid server URL \"%s\"", serverURL)
}
// Add X-Requested-By header
headers["X-Requested-By"] = requestURL.Hostname()

if strings.Contains(requestURL.String(), "multiple") {
m := &Messagebody{Metrics: h.Metrics}
http_body, err := json.Marshal(m)
Expand Down

0 comments on commit 7a2faee

Please sign in to comment.