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

Customizing JSON Parser #659

Closed
3 tasks
demon-xxi opened this issue Feb 7, 2016 · 1 comment
Closed
3 tasks

Customizing JSON Parser #659

demon-xxi opened this issue Feb 7, 2016 · 1 comment

Comments

@demon-xxi
Copy link

Separating parser plugins from input plugins was a great start.
The new JSON Parser looks good and has flexibility to specify Tags keys.
However during my integration of DeviceHive json messages I found that more options are needed:

  • Ability to extract MetricName from json message
  • Ability to extract Timestamp from json message
  • Choose json object containing metric values

To be clear, here's example of the json message produced by DeviceHive:

{
        "deviceGuid":"device_xyz",
        "notification":"ambient_stats",
        "timestamp":"2016-01-01T12:00:00Z",
        "parameters": {
                        "temperature": 100.0,
                        "humidity" : 0.76 
        } 
}

You can also see my patch on a previous version of kafka plugin to handle this format here: 0120940b27a26f59c6005acf8cb329422d912879

Let me know if there is anything I missed in existing parser that would cover that. And if these features would make sense in the overall picture of telegraf.
Another way to handle these kind of issues could be introduction of transformers that would allow to shape/strip data. Kind of how logstash does it.

demon-xxi referenced this issue Feb 7, 2016
This constitutes a large change in how we will parse different data
formats going forward (for the plugins that support it)

This is working off @henrypfhu's changes.
@sparrc
Copy link
Contributor

sparrc commented Jun 10, 2016

closing in favor of #1363

@sparrc sparrc closed this as completed Jun 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants