Adding upstream version 1.34.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
e393c3af3f
commit
4978089aab
4963 changed files with 677545 additions and 0 deletions
2
plugins/parsers/json_v2/testdata/multiple_json_input/expected.out
vendored
Normal file
2
plugins/parsers/json_v2/testdata/multiple_json_input/expected.out
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
file,from_station=COLM,to_station=ANTC,etd_estimate_direction=North minutes=2i
|
||||
file,from_station=POWL,to_station=DALY,etd_estimate_direction=South minutes=6i
|
87
plugins/parsers/json_v2/testdata/multiple_json_input/input_1.json
vendored
Normal file
87
plugins/parsers/json_v2/testdata/multiple_json_input/input_1.json
vendored
Normal file
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"?xml": {
|
||||
"@version": "1.0",
|
||||
"@encoding": "utf-8"
|
||||
},
|
||||
"root": {
|
||||
"@id": "1",
|
||||
"uri": {
|
||||
"#cdata-section": "http://api.bart.gov/api/etd.aspx?cmd=etd&orig=COLM&dir=n&json=y"
|
||||
},
|
||||
"date": "07/02/2021",
|
||||
"time": "06:05:47 PM PDT",
|
||||
"station": [
|
||||
{
|
||||
"name": "Colma",
|
||||
"abbr": "COLM",
|
||||
"etd": [
|
||||
{
|
||||
"destination": "Antioch",
|
||||
"abbreviation": "ANTC",
|
||||
"limited": "0",
|
||||
"estimate": [
|
||||
{
|
||||
"minutes": "2",
|
||||
"platform": "2",
|
||||
"direction": "North",
|
||||
"length": "10",
|
||||
"color": "YELLOW",
|
||||
"hexcolor": "#ffff33",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "16",
|
||||
"platform": "2",
|
||||
"direction": "North",
|
||||
"length": "10",
|
||||
"color": "YELLOW",
|
||||
"hexcolor": "#ffff33",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "31",
|
||||
"platform": "2",
|
||||
"direction": "North",
|
||||
"length": "10",
|
||||
"color": "YELLOW",
|
||||
"hexcolor": "#ffff33",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"destination": "Richmond",
|
||||
"abbreviation": "RICH",
|
||||
"limited": "0",
|
||||
"estimate": [
|
||||
{
|
||||
"minutes": "22",
|
||||
"platform": "2",
|
||||
"direction": "North",
|
||||
"length": "10",
|
||||
"color": "RED",
|
||||
"hexcolor": "#ff0000",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "52",
|
||||
"platform": "2",
|
||||
"direction": "North",
|
||||
"length": "10",
|
||||
"color": "RED",
|
||||
"hexcolor": "#ff0000",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"message": ""
|
||||
}
|
||||
}
|
134
plugins/parsers/json_v2/testdata/multiple_json_input/input_2.json
vendored
Normal file
134
plugins/parsers/json_v2/testdata/multiple_json_input/input_2.json
vendored
Normal file
|
@ -0,0 +1,134 @@
|
|||
{
|
||||
"?xml": {
|
||||
"@version": "1.0",
|
||||
"@encoding": "utf-8"
|
||||
},
|
||||
"root": {
|
||||
"@id": "1",
|
||||
"uri": {
|
||||
"#cdata-section": "http://api.bart.gov/api/etd.aspx?cmd=etd&orig=POWL&dir=s&json=y"
|
||||
},
|
||||
"date": "07/02/2021",
|
||||
"time": "06:06:01 PM PDT",
|
||||
"station": [
|
||||
{
|
||||
"name": "Powell St.",
|
||||
"abbr": "POWL",
|
||||
"etd": [
|
||||
{
|
||||
"destination": "Daly City",
|
||||
"abbreviation": "DALY",
|
||||
"limited": "0",
|
||||
"estimate": [
|
||||
{
|
||||
"minutes": "6",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "GREEN",
|
||||
"hexcolor": "#339933",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "26",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "9",
|
||||
"color": "BLUE",
|
||||
"hexcolor": "#0099cc",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "36",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "GREEN",
|
||||
"hexcolor": "#339933",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"destination": "Millbrae",
|
||||
"abbreviation": "MLBR",
|
||||
"limited": "0",
|
||||
"estimate": [
|
||||
{
|
||||
"minutes": "19",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "RED",
|
||||
"hexcolor": "#ff0000",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "49",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "RED",
|
||||
"hexcolor": "#ff0000",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "79",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "RED",
|
||||
"hexcolor": "#ff0000",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"destination": "SF Airport",
|
||||
"abbreviation": "SFIA",
|
||||
"limited": "0",
|
||||
"estimate": [
|
||||
{
|
||||
"minutes": "7",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "YELLOW",
|
||||
"hexcolor": "#ffff33",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "37",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "YELLOW",
|
||||
"hexcolor": "#ffff33",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
},
|
||||
{
|
||||
"minutes": "67",
|
||||
"platform": "1",
|
||||
"direction": "South",
|
||||
"length": "10",
|
||||
"color": "YELLOW",
|
||||
"hexcolor": "#ffff33",
|
||||
"bikeflag": "1",
|
||||
"delay": "0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"message": ""
|
||||
}
|
||||
}
|
18
plugins/parsers/json_v2/testdata/multiple_json_input/telegraf.conf
vendored
Normal file
18
plugins/parsers/json_v2/testdata/multiple_json_input/telegraf.conf
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
[[inputs.file]]
|
||||
files = ["./testdata/multiple_json_input/input_1.json", "./testdata/multiple_json_input/input_2.json"]
|
||||
data_format = "json_v2"
|
||||
[[inputs.file.json_v2]]
|
||||
[[inputs.file.json_v2.object]]
|
||||
path = "root.station"
|
||||
[[inputs.file.json_v2.object.tag]]
|
||||
path="#.abbr"
|
||||
rename = "from_station"
|
||||
[[inputs.file.json_v2.object.field]]
|
||||
path = "#.etd.0.estimate.0.minutes"
|
||||
rename = "minutes"
|
||||
type = "int"
|
||||
[[inputs.file.json_v2.object.tag]]
|
||||
path = "#.etd.0.abbreviation"
|
||||
rename = "to_station"
|
||||
[[inputs.file.json_v2.object.tag]]
|
||||
path = "#.etd.0.estimate.0.direction"
|
Loading…
Add table
Add a link
Reference in a new issue