-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Ability to retrieve string value via httpjson #2835
Comments
It would be great to have support for more advanced JSON parsing, I've been thinking about JSON Pointer or JSONPath. We could also add a In the meantime, you would need to use the exec plugin. |
Hello guys, Is that possible to know if this issue will be resolved on the next weeks/months ? Thank you ! |
@Dripoul I'm not aware of any direct work on this, if you are interested in working on this let me know. Don't forget you can get strings as tags today with |
I've made another input for json and xml with full tree support also with strings as value. It's still under develop but in working state. The custom tags are not implemented yet. |
In 1.8.0, this can be done with the |
@danielnelson could you please add this to the readme? Thanks. |
My previous comment has the incorrect option name, it should be https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md#json Keep in mind that this must be used with an input that supports the |
Feature Request
I'd like to retrieve a string value in an http request, for example using inputs.http-response or inputs.httpjson. However, http-response discards any text returned, and httpjson ignores values that are not numbers.
Proposal:
I'd like to be able to process a json response a la this one, to create a field called ip:
{"ip":"81.171.xx.xx"}
Alternatively, I'd like to just have the entire http reply made available as a field so I can parse it.
Current behavior:
The json parser ignores fields that are not numbers.
Desired behavior:
The json parser should include fields that contain string values.
Use case: [Why is this important (helps with prioritizing requests)]
I would like to monitor my public IP addresses, using a service such as
https://api.ipify.org?format=json
(for json) or just this to get a straight string:
https://api.ipify.org
I think it could be useful for a wide range of other purposes, where people have an HTTP-based service that returns useful data that is not just a number.
The text was updated successfully, but these errors were encountered: