-
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
feat (parser.json_v2): Support defining field/tag tables within an object table #9449
Conversation
d835326
to
61e6bf4
Compare
16811f7
to
84c30fa
Compare
Looks good! Ran this config. [[inputs.http]]
urls = ["http://api.bart.gov/api/etd.aspx?cmd=etd&orig=POWL&key=MW9S-E7SL-26DU-VV8V&json=y"
]
data_format = "json_v2"
tagexclude = ["url", "host"]
[[inputs.http.json_v2]]
[[inputs.http.json_v2.object]]
path = "root.station"
[[inputs.http.json_v2.object.tag]]
path = "#.abbr"
rename = "from_station"
# destination = ANTC
[[inputs.http.json_v2.object.tag]]
path = "#.etd.0.abbreviation"
rename = "to_station"
[[inputs.http.json_v2.object.tag]]
path = "#.etd.0.estimate.0.direction"
[[inputs.http.json_v2.object.field]]
path = "#.etd.0.estimate.0.minutes"
type = "int"
# destination = BERY
[[inputs.http.json_v2.object.tag]]
path = "#.etd.1.abbreviation"
rename = "to_station"
[[inputs.http.json_v2.object.tag]]
path = "#.etd.1.estimate.0.direction"
[[inputs.http.json_v2.object.field]]
path = "#.etd.1.estimate.0.minutes"
type = "int" with this output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! It's the first time I've properly looked at the new parser, the documentation is awesome.
Few of nits / questions around certain comments. I'll test out the build as well and leave any feedback if I notice anything, but good job.
84c30fa
to
bea665c
Compare
Thanks @helenosheaa for the review, I've addressed the changes and if you could try out the build artifacts that would be great. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested, looks good!
bea665c
to
7b91a30
Compare
Looks like new artifacts were built from this PR. Get them here!Artifact URLs |
resolves: #9381
To allow users to gather specific elements from an array, this pull request allows users to define field/tag tables within an object table. This will allow a user to gather a field/tag while still maintaining the original relationship within the JSON.
Examples of this new config feature have been added under the testdata folder in the json_v2 directory.
Here is one of the examples to give an idea of the new added feature: