Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to strip BOM character from json. httpjson plugin #3265

Closed
murray02 opened this issue Sep 25, 2017 · 3 comments · Fixed by #3267
Closed

Unable to strip BOM character from json. httpjson plugin #3265

murray02 opened this issue Sep 25, 2017 · 3 comments · Fixed by #3267
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@murray02
Copy link

Relevant telegraf.conf:

[[inputs.httpjson]]
name = "webserver_stats"
servers = [ "http://localhost:1234/v2/json" ]
response_timeout = "5s"
method = "GET"
tag_keys = [ "Meters" ]#

System info:

C:\telegraf>telegraf.exe --version
Telegraf v1.3.5 (git: release-1.3 7192e68)

Windows Server 2012

Steps to reproduce:

  1. Metrics.net application writes to localhost:1234/vs/json with Json object including BOM character.

Expected behavior:

httpjson plugin strips BOM character from the start of the json object

Actual behavior:

2017-09-25T14:01:45Z E! Error in plugin [inputs.httpjson]: unable to parse out as JSON, invalid character 'ï' looking for beginning of value
2017-09-25T14:01:50Z E! Error in plugin [inputs.httpjson]: unable to parse out as JSON, invalid character 'ï' looking for beginning of value

Use case: [Why is this important (helps with prioritizing requests)]

Any Metrics.Net application cannot pick up application metrics using telegraf.

@danielnelson danielnelson added this to the 1.4.2 milestone Sep 25, 2017
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Sep 25, 2017
@murray02
Copy link
Author

Tracking this. Is there a way to build the source of this in windows. The details on the homepage only builds Linux. I can open a seperate ticket but just wanted to see if this is possible.

@danielnelson
Copy link
Contributor

Yes, instructions are actually the same for Windows but if you don't want to install GNU make you can instead run the commands manually after you have Go installed and setup:

go get github.com/sparrc/gdm
gdm restore
go build -i -o telegraf.exe ./cmd/telegraf/telegraf.go

@murray02
Copy link
Author

Just wanted to leave a thanks @danielnelson for this! You saved a deadline!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants