1
0
Fork 0

Adding upstream version 1.34.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-24 07:26:29 +02:00
parent e393c3af3f
commit 4978089aab
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
4963 changed files with 677545 additions and 0 deletions

View file

@ -0,0 +1 @@
weight,customer_name=Customer,imei=123,serial_number=AX00 weight=289.799

View file

@ -0,0 +1,10 @@
{
"weight_ROWKEY": "123",
"weight_serialNumber": "AX00",
"weight_createdAt": 1644708158939,
"weight_weight": 289.799,
"sensor_imei": "123",
"sensor_distributor_name": null,
"sensor_customer_name": "Customer",
"sensor_dist_name": null
}

View file

@ -0,0 +1,25 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/5940
[[inputs.file]]
files = ["./testdata/10670/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "weight"
timestamp_format = "unix_ms"
timestamp_path = "weight_createdAt"
[[inputs.file.json_v2.field]]
path = "weight_weight"
rename = "weight"
type = "float"
[[inputs.file.json_v2.tag]]
path = "weight_serialNumber"
rename = "serial_number"
[[inputs.file.json_v2.tag]]
path = "weight_ROWKEY"
rename = "imei"
[[inputs.file.json_v2.tag]]
path = "sensor_customer_name"
rename = "customer_name"
[[inputs.file.json_v2.tag]]
path = "sensor_distributor_name"
rename = "distributor_name"

View file

@ -0,0 +1,2 @@
file properties_mag=5.17
file properties_mag=6.2

View file

@ -0,0 +1,14 @@
{
"features": [
{
"properties": {
"mag": 5.17
}
},
{
"properties": {
"mag": 6.2
}
}
]
}

View file

@ -0,0 +1,9 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/5940
[[inputs.file]]
files = ["./testdata/array_of_objects/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "features"

View file

@ -0,0 +1,34 @@
{
"metrics": [
{
"name": "impression",
"timestamp": 1653643420,
"fields": {
"count_sum": 5
},
"tags": {
"key": "12345",
"flagname": "F5",
"host": "1cbbb3796fc2",
"platform": "Java",
"sdkver": "4.9.1",
"value": "false"
}
},
{
"name": "expression",
"timestamp": 1653646789,
"fields": {
"count_sum": 42
},
"tags": {
"key": "67890",
"flagname": "E42",
"host": "klaus",
"platform": "Golang",
"sdkver": "1.18.3",
"value": "true"
}
}
]
}

View file

@ -0,0 +1,2 @@
benchmark count_sum=5,flagname="F5",host="1cbbb3796fc2",key="12345",name="impression",platform="Java",sdkver="4.9.1",timestamp=1653643420,value="false" 1697730835574029794
benchmark count_sum=42,flagname="E42",host="klaus",key="67890",name="expression",platform="Golang",sdkver="1.18.3",timestamp=1653646789,value="true" 1697730835574029794

View file

@ -0,0 +1,34 @@
{
"metrics": [
{
"name": "impression",
"timestamp": 1653643420,
"fields": {
"count_sum": 5
},
"tags": {
"key": "12345",
"flagname": "F5",
"host": "1cbbb3796fc2",
"platform": "Java",
"sdkver": "4.9.1",
"value": "false"
}
},
{
"name": "expression",
"timestamp": 1653646789,
"fields": {
"count_sum": 42
},
"tags": {
"key": "67890",
"flagname": "E42",
"host": "klaus",
"platform": "Golang",
"sdkver": "1.18.3",
"value": "true"
}
}
]
}

View file

@ -0,0 +1,9 @@
[[inputs.file]]
files = ["./testdata/benchmark/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "benchmark"
[[inputs.file.json_v2.object]]
path = 'metrics'
disable_prepend_keys = true

View file

@ -0,0 +1,3 @@
file,properties_place=Antelope\ Valley\,\ CA geometry_coordinates=-119.4998333,geometry_type="Point",id="nc73584926",properties_mag=6,properties_updated=1.626277167263e+12,type="Feature"
file,properties_place=Antelope\ Valley\,\ CA geometry_coordinates=38.5075,geometry_type="Point",id="nc73584926",properties_mag=6,properties_updated=1.626277167263e+12,type="Feature"
file,properties_place=Antelope\ Valley\,\ CA geometry_coordinates=7.45,geometry_type="Point",id="nc73584926",properties_mag=6,properties_updated=1.626277167263e+12,type="Feature"

View file

@ -0,0 +1,31 @@
{
"type": "FeatureCollection",
"metadata": {
"generated": 1626285886000,
"url": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/significant_week.geojson",
"title": "USGS Significant Earthquakes, Past Week",
"status": 200,
"api": "1.10.3",
"count": 1
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 6,
"place": "Antelope Valley, CA",
"time": 1625784588110,
"updated": 1626277167263
},
"geometry": {
"type": "Point",
"coordinates": [
-119.4998333,
38.5075,
7.45
]
},
"id": "nc73584926"
}
]
}

View file

@ -0,0 +1,9 @@
[[inputs.file]]
files = ["./testdata/complex_nesting/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "features"
timestamp_key = "properties_time"
timestamp_format = "unix_ms"
tags = ["properties_place"]

View file

@ -0,0 +1,2 @@
file,status=200 duration=2i,json_duration=100
file,status=200 duration=2i,json_duration=60

View file

@ -0,0 +1,46 @@
{
"message": "abc",
"fields": {
"status": 200,
"key": 1,
"json": [
{
"duration": 100,
"code": 1,
"label": 2,
"line": 3,
"many": 4,
"more": 5,
"numerical": 6,
"fields": 7,
"nest": {
"label": 2,
"line": 3,
"many": 4,
"more": 5,
"numerical": 4,
"fields": 7
}
},
{
"duration": 60,
"code": 1,
"label": 2,
"line": 3,
"many": 4,
"more": 5,
"numerical": 6,
"fields": 7,
"nest": {
"label": 2,
"line": 3,
"many": 4,
"more": 5,
"numerical": 6,
"fields": 7
}
}
],
"duration": 2
}
}

View file

@ -0,0 +1,14 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/1363
[[inputs.file]]
files = ["./testdata/fields_and_tags/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.tag]]
path = "fields.status"
[[inputs.file.json_v2.field]]
path = "fields.json.#.duration"
rename = "json_duration"
[[inputs.file.json_v2.field]]
path = "fields.duration"
type = "int"

View file

@ -0,0 +1,5 @@
bart_json_v2,name=Powell\ St. minutes=9i
bart_json_v2,name=Powell\ St. minutes=40i
bart_json_v2,name=Powell\ St. minutes=70i
bart_json_v2,name=Powell\ St. minutes=12i
bart_json_v2,name=Powell\ St. minutes=42i

View 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=POWL&json=y"
},
"date": "06/03/2021",
"time": "09:46:01 AM PDT",
"station": [
{
"name": "Powell St.",
"abbr": "POWL",
"etd": [
{
"destination": "Antioch",
"abbreviation": "ANTC",
"limited": "0",
"estimate": [
{
"minutes": "9",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "40",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "70",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
}
]
},
{
"destination": "Berryessa",
"abbreviation": "BERY",
"limited": "0",
"estimate": [
{
"minutes": "12",
"platform": "2",
"direction": "North",
"length": "10",
"color": "GREEN",
"hexcolor": "#339933",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "42",
"platform": "2",
"direction": "North",
"length": "10",
"color": "GREEN",
"hexcolor": "#339933",
"bikeflag": "1",
"delay": "0"
}
]
}
]
}
],
"message": ""
}
}

View file

@ -0,0 +1,10 @@
[[inputs.file]]
files = ["./testdata/fields_and_tags_complex/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "bart_json_v2"
[[inputs.file.json_v2.tag]]
path = "root.station.#.name"
[[inputs.file.json_v2.field]]
path = "root.station.#.etd.#.estimate.#.minutes"
type = "int"

View file

@ -0,0 +1,3 @@
file large=4294967296i,larger=9007199254740991i,largest=9223372036854775807i
file large=9007199254740991u,larger=9223372036854775807u,largest=18446744073709551615u
file large=4294967296,larger=4.294967296663e+09,largest=9007199254740991

View file

@ -0,0 +1,17 @@
{
"int": {
"large": 4294967296,
"larger": 9007199254740991,
"largest": 9223372036854775807
},
"uint": {
"large": 9007199254740991,
"larger": 9223372036854775807,
"largest": 18446744073709551615
},
"float": {
"large": 4294967296,
"larger": 4.294967296663e+09,
"largest": 9007199254740991
}
}

View file

@ -0,0 +1,22 @@
[[inputs.file]]
files = ["./testdata/large_numbers/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "int"
[inputs.file.json_v2.object.fields]
large = "int"
larger = "int"
largest = "int"
[[inputs.file.json_v2.object]]
path = "uint"
[inputs.file.json_v2.object.fields]
large = "uint"
larger = "uint"
largest = "uint"
[[inputs.file.json_v2.object]]
path = "float"
[inputs.file.json_v2.object.fields]
large = "float"
larger = "float"
largest = "float"

View file

@ -0,0 +1 @@
32 label="Basic"

View file

@ -0,0 +1,19 @@
{
"value_id": "52-32-1-0",
"node_id": 52,
"class_id": 32,
"type": "byte",
"genre": "basic",
"instance": 1,
"index": 0,
"label": "Basic",
"units": "",
"help": "Basic status of the node",
"read_only": false,
"write_only": false,
"min": 0,
"max": 255,
"is_polled": false,
"value": 0,
"lastUpdate": 1584636017962
}

View file

@ -0,0 +1,9 @@
# Example taken from: https://github.com/influxdata/feature-requests/issues/160
[[inputs.file]]
files = ["./testdata/measurement_name_int/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name_path = "class_id"
[[inputs.file.json_v2.field]]
path = "label"

View file

@ -0,0 +1 @@
openweather,id=2.643743e+06,name=London coord_lat=51.5085,coord_lon=-0.1257,description="few clouds",main_temp=12.54,summary="Clouds",wind_speed=2.11 1628186541000000000

View file

@ -0,0 +1,44 @@
{
"coord": {
"lon": -0.1257,
"lat": 51.5085
},
"weather": [
{
"id": 801,
"main": "Clouds",
"description": "few clouds",
"icon": "02n"
}
],
"base": "stations",
"main": {
"temp": 12.54,
"feels_like": 11.86,
"temp_min": 10.49,
"temp_max": 14.27,
"pressure": 1024,
"humidity": 77
},
"visibility": 10000,
"wind": {
"speed": 2.11,
"deg": 254,
"gust": 4.63
},
"clouds": {
"all": 21
},
"dt": 1633545358,
"sys": {
"type": 2,
"id": 2019646,
"country": "GB",
"sunrise": 1633500560,
"sunset": 1633541256
},
"timezone": 3600,
"id": 2643743,
"name": "London",
"cod": 200
}

View file

@ -0,0 +1,15 @@
[[inputs.file]]
files = ["./testdata/mix_field_and_object/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "openweather"
[[inputs.file.json_v2.field]]
path = "weather.#.main"
rename = "summary"
[[inputs.file.json_v2.field]]
path = "weather.#.description"
[[inputs.file.json_v2.object]]
path = "@this"
included_keys = ["coord_lat", "coord_lon", "main_temp", "wind_speed"] # List of JSON keys (for a nested key, prepend the parent keys with underscores) that should be only included in result
tags = ["id", "name"] # List of JSON keys (for a nested key, prepend the parent keys with underscores) to be a tag instead of a field

View file

@ -0,0 +1,8 @@
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="A Long-expected Party",name="Bilbo",random=1,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="The Shadow of the Past",name="Bilbo",random=1,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="A Long-expected Party",name="Frodo",random=1,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="The Shadow of the Past",name="Frodo",random=1,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="A Long-expected Party",name="Bilbo",random=2,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="The Shadow of the Past",name="Bilbo",random=2,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="A Long-expected Party",name="Frodo",random=2,species="hobbit"
file,title=The\ Lord\ Of\ The\ Rings author="Tolkien",chapters="The Shadow of the Past",name="Frodo",random=2,species="hobbit"

View file

@ -0,0 +1,24 @@
{
"book": {
"title": "The Lord Of The Rings",
"chapters": [
"A Long-expected Party",
"The Shadow of the Past"
],
"author": "Tolkien",
"characters": [
{
"name": "Bilbo",
"species": "hobbit"
},
{
"name": "Frodo",
"species": "hobbit"
}
],
"random": [
1,
2
]
}
}

View file

@ -0,0 +1,11 @@
# Example getting nested fields with duplicate names
# Example taken from: https://github.com/influxdata/telegraf/issues/1363
[[inputs.file]]
files = ["./testdata/multiple_arrays_in_object/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "book"
tags = ["title"]
disable_prepend_keys = true

View 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

View 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": ""
}
}

View 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": ""
}
}

View 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"

View file

@ -0,0 +1,2 @@
file name="fire" 1555745371450794118
file name="flood" 1555745371450794118

View file

@ -0,0 +1,12 @@
{
"events": [
{
"name": "fire",
"time": "1555745371410"
},
{
"name": "flood",
"time": "1555745371410"
}
]
}

View file

@ -0,0 +1,10 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/5940
[[inputs.file]]
files = ["./testdata/multiple_timestamps/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "events"
timestamp_key = "time"
timestamp_format = "unix_ms"

View file

@ -0,0 +1,12 @@
file,hostname=testhost1,outputname=1A-CC01-PC01 systemVoltage=-54.1,systemCurrent=-3.8
file,hostname=testhost1,outputname=2A-CC01-KA01 systemVoltage=-54.1,systemCurrent=-3.8
file,hostname=testhost1,outputname=3A-CC01-CC02 systemVoltage=-54.1,systemCurrent=-3.8
file,hostname=testhost1,outputname=4A systemVoltage=-54.1,systemCurrent=-3.8
file,hostname=testhost1,outputname=5A systemVoltage=-54.1,systemCurrent=-3.8
file,hostname=testhost1,outputname=6A-CC01-88-INV01-A systemVoltage=-54.1,systemCurrent=-3.8
file,hostname=testhost2,outputname=1A systemVoltage=27.5,systemCurrent=9.5
file,hostname=testhost2,outputname=2A systemVoltage=27.5,systemCurrent=9.5
file,hostname=testhost2,outputname=3A systemVoltage=27.5,systemCurrent=9.5
file,hostname=testhost2,outputname=4A systemVoltage=27.5,systemCurrent=9.5
file,hostname=testhost2,outputname=5A systemVoltage=27.5,systemCurrent=9.5
file,hostname=testhost2,outputname=6A systemVoltage=27.5,systemCurrent=9.5

View file

@ -0,0 +1,174 @@
[
{
"hostname": "testhost1",
"systemVoltage": -54.1,
"systemCurrent": -3.8,
"tables": [
{
"outputnumber": 0.0,
"outputname": "1A-CC01-PC01",
"outputcurrent": -2.7,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 1.0,
"outputname": "2A-CC01-KA01",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 2.0,
"outputname": "3A-CC01-CC02",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 3.0,
"outputname": "4A",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 4.0,
"outputname": "5A",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 5.0,
"outputname": "6A-CC01-88-INV01-A",
"outputcurrent": -1.1,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"busnumber": 0.0,
"busname": "A--48A",
"busvoltage": -54.1,
"buscurrent": -3.8
},
{
"busnumber": 1.0,
"busname": "B--48B",
"busvoltage": -53.9,
"buscurrent": -4.2
},
{
"alarmnumber": 0.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 1.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 2.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 3.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 4.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
}
]
},
{
"hostname": "testhost2",
"systemVoltage": 27.5,
"systemCurrent": 9.5,
"tables": [
{
"outputnumber": 0.0,
"outputname": "1A",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 1.0,
"outputname": "2A",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 2.0,
"outputname": "3A",
"outputcurrent": 0.0,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 3.0,
"outputname": "4A",
"outputcurrent": 0.6,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 4.0,
"outputname": "5A",
"outputcurrent": 6.5,
"outputfusestatus": 1.0,
"outputenable": 1.0
},
{
"outputnumber": 5.0,
"outputname": "6A",
"outputcurrent": 0.0,
"outputfusestatus": 2.0,
"outputenable": 1.0
},
{
"busnumber": 0.0,
"busname": "A-24V",
"busvoltage": 27.6,
"buscurrent": 0.6
},
{
"busnumber": 1.0,
"busname": "B-12V",
"busvoltage": 13.8,
"buscurrent": 0.0
},
{
"alarmnumber": 0.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 1.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 2.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 3.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
},
{
"alarmnumber": 4.0,
"alarmname": "\u0000",
"alarmstatus": 1.0
}
]
}
]

View file

@ -0,0 +1,16 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/6437
# Parse String types from JSON
[[inputs.file]]
files = ["./testdata/nested_and_nonnested_tags/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
disable_prepend_keys = true
path = "@this"
included_keys = [
"systemVoltage",
"systemCurrent",
"tables",
]
tags = ["hostname", "tables_outputname"]

View file

@ -0,0 +1,2 @@
new_metric,name=partition LogEndOffset=339238i,LogStartOffset=339238i,NumLogSegments=1i,Size=0i,UnderReplicatedPartitions=0i 1610056029037925000
new_metric,name=partition LogEndOffset=33914i,LogStartOffset=33238i,NumLogSegments=1i,Size=2i,UnderReplicatedPartitions=5i 1610056029037956000

View file

@ -0,0 +1,36 @@
[
{
"data": {
"LogEndOffset": 339238,
"LogStartOffset": 339238,
"NumLogSegments": 1,
"Size": 0,
"UnderReplicatedPartitions": 0
},
"name": "partition",
"tags": {
"host": "CUD1-001559",
"jolokia_agent_url": "http://localhost:7777/jolokia",
"partition": "1",
"topic": "qa-kafka-connect-logs"
},
"timestamp": 1591124461
},
{
"data": {
"LogEndOffset": 33914,
"LogStartOffset": 33238,
"NumLogSegments": 1,
"Size": 2,
"UnderReplicatedPartitions": 5
},
"name": "partition",
"tags": {
"host": "CUD1-001559",
"jolokia_agent_url": "http://localhost:7777/jolokia",
"partition": "1",
"topic": "qa-kafka-connect-logs"
},
"timestamp": 1591124461
}
]

View file

@ -0,0 +1,15 @@
# Example taken from: https://github.com/influxdata/feature-requests/issues/160
[[inputs.file]]
files = ["./testdata/nested_array_of_objects/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "new_metric"
[[inputs.file.json_v2.object]]
path = "@this"
disable_prepend_keys = true
excluded_keys = ["tags", "timestamp"]
tags = ["name"]
[inputs.file.json_v2.object.fields]
data = "int"

View file

@ -0,0 +1,5 @@
file,datatype=float,name=inlet-1/temperature value_f=0.20791169081775931 1695679023000000000
file,datatype=float value_f=-0.3090169943749477,name="inlet-1/temperature" 1695679077000000000
file,datatype=string value_s="-0.3090169943749477",name="inlet-3/flow" 1695679077000000000
file,datatype=int value_i=95i,name="inlet-2/temperature" 1695679077000000000
file,datatype=bool value_b=true,name="inlet-2/flow" 1695679077000000000

View file

@ -0,0 +1,25 @@
{
"timestamp": 1695679077118.0,
"metrics": [
{
"value": -0.3090169943749477,
"name": "inlet-1/temperature",
"datatype": "float"
},
{
"value": 95,
"name": "inlet-2/temperature",
"datatype": "int"
},
{
"value": true,
"name": "inlet-2/flow",
"datatype": "bool"
},
{
"value": "-0.3090169943749477",
"name": "inlet-3/flow",
"datatype": "string"
}
]
}

View file

@ -0,0 +1,6 @@
{
"timestamp": 1695679022882.0,
"value": 0.20791169081775931,
"name": "inlet-1/temperature",
"datatype": "float"
}

View file

@ -0,0 +1,58 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/13990
# Parse String types from JSON
[[inputs.file]]
files = ["./testdata/nested_objects_optional/nested_objects_single.json", "./testdata/nested_objects_optional/nested_objects_nest.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
timestamp_path = 'timestamp'
timestamp_format = 'unix_ms'
[[inputs.file.json_v2.tag]]
path = 'name'
optional = true
[[inputs.file.json_v2.tag]]
path = 'datatype'
optional = true
[[inputs.file.json_v2.field]]
path = 'value'
rename = 'value_f'
optional = true
[[inputs.file.json_v2.object]]
path = 'metrics.#(datatype=="float")#'
optional = true
tags = ['datatype']
[inputs.file.json_v2.object.renames]
value = 'value_f'
[inputs.file.json_v2.object.fields]
value = 'float'
[[inputs.file.json_v2.object]]
path = 'metrics.#(datatype=="string")#'
optional = true
tags = ['datatype']
[inputs.file.json_v2.object.renames]
value = 'value_s'
[inputs.file.json_v2.object.fields]
value = 'string'
[[inputs.file.json_v2.object]]
path = 'metrics.#(datatype=="int")#'
optional = true
tags = ['datatype']
[inputs.file.json_v2.object.renames]
value = 'value_i'
[inputs.file.json_v2.object.fields]
value = 'int'
[[inputs.file.json_v2.object]]
path = 'metrics.#(datatype=="bool")#'
optional = true
tags = ['datatype']
[inputs.file.json_v2.object.renames]
value = 'value_b'
[inputs.file.json_v2.object.fields]
value = 'bool'

View file

@ -0,0 +1,2 @@
file,Firmware=LDGSW07G,Model=WDC\ WUH721414ALE604,Serial=9JHNGTUT Count=0,Errors=0
file,Firmware=LDGSW07G,Model=WDC\ WUH721414ALE604,Serial=9JHLPW9T Errors=0,Count=0

View file

@ -0,0 +1,16 @@
{
"device0": {
"Count": 0,
"Errors": 0,
"Serial": "9JHNGTUT",
"Model": "WDC WUH721414ALE604",
"Firmware": "LDGSW07G"
},
"device1": {
"Count": 0,
"Errors": 0,
"Serial": "9JHLPW9T",
"Model": "WDC WUH721414ALE604",
"Firmware": "LDGSW07G"
}
}

View file

@ -0,0 +1,12 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/6853
[[inputs.file]]
files = ["./testdata/nested_tags/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "device0"
tags = ["Firmware", "Model", "Serial"]
[[inputs.file.json_v2.object]]
path = "device1"
tags = ["Firmware", "Model", "Serial"]

View file

@ -0,0 +1,3 @@
file,Firmware=LDGSW07G,Model=WDC\ WUH721414ALE604,Serial=9JHNGTUT Count=0,Errors=0
file,Firmware=LDGSW07G,Model=WDC\ WUH721414ALE604,Serial=9JHNGHJBT Errors=0,Count=2
file,Firmware=LDGSW07G,Model=WDC\ WUH721414ALE604,Serial=9JHLPW9T Errors=0,Count=0

View file

@ -0,0 +1,35 @@
{
"Group A": [
{
"Sub-group 1": [
{
"Count": 0,
"Errors": 0,
"Serial": "9JHNGTUT",
"Model": "WDC WUH721414ALE604",
"Firmware": "LDGSW07G"
},
{
"Count": 2,
"Errors": 0,
"Serial": "9JHNGHJBT",
"Model": "WDC WUH721414ALE604",
"Firmware": "LDGSW07G"
}
]
}
],
"Group B": [
{
"Sub-group 1": [
{
"Count": 0,
"Errors": 0,
"Serial": "9JHLPW9T",
"Model": "WDC WUH721414ALE604",
"Firmware": "LDGSW07G"
}
]
}
]
}

View file

@ -0,0 +1,14 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/6853
[[inputs.file]]
files = ["./testdata/nested_tags_complex/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "Group A"
disable_prepend_keys = true
tags = ["Sub-group_1_Firmware", "Sub-group_1_Model", "Sub-group_1_Serial"]
[[inputs.file.json_v2.object]]
path = "Group B"
disable_prepend_keys = true
tags = ["Sub-group_1_Firmware", "Sub-group_1_Model", "Sub-group_1_Serial"]

View file

@ -0,0 +1 @@
file,id=ak0217l8ue0x,type=Feature detail="https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ak0217l8ue0x.geojson",mag=1.5,place="63 km N of Petersville, Alaska",status="automatic",time=1623708726566,updated=1623709998223,url="https://earthquake.usgs.gov/earthquakes/eventpage/ak0217l8ue0x"

View file

@ -0,0 +1,40 @@
{
"type": "FeatureCollection",
"metadata": {
"generated": 1623710450000,
"url": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_hour.geojson",
"title": "USGS All Earthquakes, Past Hour",
"status": 200,
"api": "1.10.3",
"count": 10
},
"features": [
{
"type": "Feature",
"properties": {
"mag": 1.5,
"place": "63 km N of Petersville, Alaska",
"time": 1623708726566,
"updated": 1623709998223,
"tz": null,
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/ak0217l8ue0x",
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ak0217l8ue0x.geojson",
"felt": null,
"cdi": null,
"mmi": null,
"alert": null,
"status": "automatic"
},
"id": "ak0217l8ue0x"
}
],
"bbox": [
-157.5749,
32.9001667,
0.25,
-115.6211667,
66.331,
132.5
]
}

View file

@ -0,0 +1,8 @@
[[inputs.file]]
files = ["./testdata/null/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "features"
tags = ["type", "id"]
disable_prepend_keys = true

View file

@ -0,0 +1,5 @@
bart_json_v2,destination=Antioch,name=Colma minutes=13i
bart_json_v2,destination=Antioch,name=Colma minutes=43i
bart_json_v2,destination=Millbrae,name=Colma minutes=19i
bart_json_v2,destination=Millbrae,name=Colma minutes=49i
bart_json_v2,destination=Millbrae,name=Colma minutes=79i

View 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&json=y"
},
"date": "06/03/2021",
"time": "12:54:31 PM PDT",
"station": [
{
"name": "Colma",
"abbr": "COLM",
"etd": [
{
"destination": "Antioch",
"abbreviation": "ANTC",
"limited": "0",
"estimate": [
{
"minutes": "13",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "43",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"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"
}
]
}
]
}
],
"message": ""
}
}

View file

@ -0,0 +1,12 @@
[[inputs.file]]
files = ["./testdata/object/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "bart_json_v2"
[[inputs.file.json_v2.object]]
path = "root.station"
disable_prepend_keys = true
included_keys = ["etd_estimate_minutes"]
tags = ["name", "etd_destination"]
[inputs.file.json_v2.object.fields]
etd_estimate_minutes = "int"

View file

@ -0,0 +1,5 @@
api_http_status_codes 200=11586,201=16,202=14,204=8,404=43,500=0,503=0 1741532840501119000
api_requests requests=11668 1741532840501225000
api_responses responses=11667 1741532840501263000
api_av sessions_added=0,sessions_removed=0 1741544068286646000

View file

@ -0,0 +1,21 @@
{
"api": {
"http_status_codes": {
"200": 11586,
"201": 16,
"202": 14,
"204": 8,
"404": 43,
"500": 0,
"503": 0
},
"requests": 11668,
"responses": 11667,
"av": {
"sessions": {
"added": 0,
"removed": 0
}
}
}
}

View file

@ -0,0 +1,23 @@
[[inputs.file]]
files = ["./testdata/object_multiple/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "api_http_status_codes"
[[inputs.file.json_v2.object]]
path = "api.http_status_codes"
[[inputs.file.json_v2]]
measurement_name = "api_requests"
[[inputs.file.json_v2.field]]
path = "api.requests"
[[inputs.file.json_v2]]
measurement_name = "api_responses"
[[inputs.file.json_v2.field]]
path = "api.responses"
[[inputs.file.json_v2]]
measurement_name = "api_av"
[[inputs.file.json_v2.object]]
path = "api.av"

View file

@ -0,0 +1,3 @@
metric,id=100 value=100.123 1609459199000000000
metric,id=101 value=200.001 1276605000000000000
metric,id=102 value=999.999 946684800000000000

View file

@ -0,0 +1,19 @@
{
"events": [
{
"id": 100,
"value": 100.123,
"time": "2020-12-31T23:59:59Z"
},
{
"id": 101,
"value": 200.001,
"time": "2010-06-15T12:30:00Z"
},
{
"id": 102,
"value": 999.999,
"time": "2000-01-01T00:00:00Z"
}
]
}

View file

@ -0,0 +1,12 @@
[[inputs.file]]
files = ["./testdata/object_timestamp/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "metric"
[[inputs.file.json_v2.object]]
path = "events"
tags = ["id"]
timestamp_key = "time"
timestamp_format = "2006-01-02T15:04:05Z"

View file

View file

@ -0,0 +1,3 @@
{
"test": "test"
}

View file

@ -0,0 +1,15 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/7097
# Parse String types from JSON
[[inputs.file]]
files = ["./testdata/optional/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.field]]
path = "wrong"
optional = true
[[inputs.file.json_v2.object]]
path = "wrong"
optional = true

View file

@ -0,0 +1,3 @@
file,Meter_number=12344 Power_curr=168,Total_in=2769.492 1646326975000000000
file Humidity=63.3,Pressure=1020.6,Temperature=22.5 1646335555000000000
file Illuminance=2.022 1646335555000000000

View file

@ -0,0 +1 @@
{"Time":"2022-03-03T17:02:55","MT681":{"Power_curr":168,"Total_in":2769.492,"Meter_number":"12344"}}

View file

@ -0,0 +1 @@
{"Time":"2022-03-03T19:25:55","BME280":{"Temperature":22.5,"Humidity":63.3,"DewPoint":15.1,"Pressure":1020.6,"SeaPressure":1024.1},"TSL2561":{"Illuminance":2.022,"IR":16,"Broadband":78},"PressureUnit":"hPa","TempUnit":"C"}

View file

@ -0,0 +1,21 @@
# Parse different objects
[[inputs.file]]
files = ["./testdata/optional_objects/input_1.json", "./testdata/optional_objects/input_2.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
timestamp_path = "Time"
timestamp_format = "2006-01-02T15:04:05"
[[inputs.file.json_v2.object]]
path = "BME280"
included_keys = ["Humidity", "Pressure", "Temperature"]
optional = true
[[inputs.file.json_v2.object]]
path = "TSL2561"
included_keys = ["Illuminance"]
optional = true
[[inputs.file.json_v2.object]]
path = "MT681"
optional = true
tags = ["Meter_number"]

View file

@ -0,0 +1 @@
file,from_station=COLM,to_station=ANTC,etd_estimate_direction=North etd_estimate_minutes=6i

View file

@ -0,0 +1,97 @@
{
"?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": "06/25/2021",
"time": "05:01:31 PM PDT",
"station": [
{
"name": "Colma",
"abbr": "COLM",
"etd": [
{
"destination": "Antioch",
"abbreviation": "ANTC",
"limited": "0",
"estimate": [
{
"minutes": "6",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "36",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "51",
"platform": "2",
"direction": "North",
"length": "10",
"color": "YELLOW",
"hexcolor": "#ffff33",
"bikeflag": "1",
"delay": "0"
}
]
},
{
"destination": "Richmond",
"abbreviation": "RICH",
"limited": "0",
"estimate": [
{
"minutes": "12",
"platform": "2",
"direction": "North",
"length": "10",
"color": "RED",
"hexcolor": "#ff0000",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "26",
"platform": "2",
"direction": "North",
"length": "10",
"color": "RED",
"hexcolor": "#ff0000",
"bikeflag": "1",
"delay": "0"
},
{
"minutes": "41",
"platform": "2",
"direction": "North",
"length": "10",
"color": "RED",
"hexcolor": "#ff0000",
"bikeflag": "1",
"delay": "0"
}
]
}
]
}
],
"message": ""
}
}

View file

@ -0,0 +1,17 @@
[[inputs.file]]
files = ["./testdata/subfieldtag_in_object/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "root.station"
[[inputs.file.json_v2.object.field]]
path = "#.etd.0.estimate.0.minutes"
type = "int"
[[inputs.file.json_v2.object.tag]]
path = "#.abbr"
rename = "from_station"
[[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"

View file

@ -0,0 +1,4 @@
file,data=3 cnt=23i,format=0i
file,data=7 cnt=23i,format=0i
file,data=10 cnt=23i,format=0i
file,data=23 cnt=23i,format=0i

View file

@ -0,0 +1,10 @@
{
"cnt": 23,
"data": [
3,
7,
10,
23
],
"format": 0
}

View file

@ -0,0 +1,16 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/5940
[[inputs.file]]
files = ["./testdata/subfieldtag_in_object_2/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "@this"
[[inputs.file.json_v2.object.tag]]
path = "data"
[[inputs.file.json_v2.object.field]]
path = "cnt"
type = "int"
[[inputs.file.json_v2.object.field]]
path = "format"
type = "int"

View file

@ -0,0 +1,4 @@
file,name=temperature,units=℃ value=23.4 1555745371450794118
file,name=moisture,units=% value=5 1555745371450794118
file,name=light,units=lux value=10118 1555745371450794118
file,name=fertility,units=us/cm value=0 1555745371450794118

View file

@ -0,0 +1,25 @@
{
"time": 1555745371410,
"measurements": [
{
"name": "temperature",
"value": 23.4,
"units": "℃"
},
{
"name": "moisture",
"value": 5,
"units": "%"
},
{
"name": "light",
"value": 10118,
"units": "lux"
},
{
"name": "fertility",
"value": 0,
"units": "us/cm"
}
]
}

View file

@ -0,0 +1,11 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/5940
[[inputs.file]]
files = ["./testdata/timestamp/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
timestamp_path = "time"
timestamp_format = "unix_ms"
[[inputs.file.json_v2.object]]
path = "measurements"
tags = ["name", "units"]

View file

@ -0,0 +1,2 @@
test value=0 1631202459121654321
test value=1 1631202459121654321

View file

@ -0,0 +1,7 @@
{
"test": [
{ "value": 0 },
{ "value": 1 }
],
"timestamp": 1631202459121654321
}

View file

@ -0,0 +1,11 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/5940
[[inputs.file]]
files = ["./testdata/timestamp_ns/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
measurement_name = "test"
timestamp_path = "timestamp"
timestamp_format = "unix_ns"
[[inputs.file.json_v2.object]]
path = "test"

View file

@ -0,0 +1 @@
file f="value" 1644434944000000000

View file

@ -0,0 +1,4 @@
{
"when": "2022-02-09T19:29:04Z",
"f": "value"
}

View file

@ -0,0 +1,8 @@
[[inputs.file]]
files = ["./testdata/timestamp_rfc3339/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
timestamp_path = "when"
timestamp_format = "rfc3339"
[[inputs.file.json_v2.field]]
path = "f"

View file

@ -0,0 +1,4 @@
file explicitstringtypeName="Bilbo",defaultstringtypeName="Baggins",convertbooltostringName="true",convertinttostringName="1",convertfloattostringName="1.1"
file defaultinttypeName=2,convertfloatointName=3i,convertstringtointName=4i,convertbooltointName=0i,explicitinttypeName=1i,uinttype=1u
file convertstringtofloatName=4.1,explicitfloattypeName=1.1,defaultfloattypeName=2.1,convertintotfloatName=3
file explicitbooltypeName=true,defaultbooltypeName=false,convertinttoboolName=true,convertstringtoboolName=false,convertintstringtoboolTrueName=true,convertintstringtoboolFalseName=false

View file

@ -0,0 +1,22 @@
{
"explicitstringtype": "Bilbo",
"defaultstringtype": "Baggins",
"convertbooltostring": true,
"convertinttostring": 1,
"convertfloattostring": 1.1,
"explicitinttype": 1,
"defaultinttype": 2,
"convertfloatoint": 3.1,
"convertstringtoint": "4",
"convertbooltoint": false,
"explicitfloattype": 1.1,
"defaultfloattype": 2.1,
"convertintotfloat": 3,
"convertstringtofloat": "4.1",
"explicitbooltype": true,
"defaultbooltype": false,
"convertinttobool": 1,
"convertstringtobool": "false",
"convertintstringtoboolTrue": "1",
"convertintstringtoboolFalse": "0"
}

View file

@ -0,0 +1,105 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/7097
# Parse String types from JSON
[[inputs.file]]
files = ["./testdata/types/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.field]]
rename = "explicitstringtypeName"
path = "explicitstringtype"
type = "string"
[[inputs.file.json_v2.field]]
rename = "defaultstringtypeName"
path = "defaultstringtype"
[[inputs.file.json_v2.field]]
rename = "convertbooltostringName"
path = "convertbooltostring"
type = "string"
[[inputs.file.json_v2.field]]
rename = "convertinttostringName"
path = "convertinttostring"
type = "string"
[[inputs.file.json_v2.field]]
rename = "convertfloattostringName"
path = "convertfloattostring"
type = "string"
# Parse int types from JSON
[[inputs.file]]
files = ["./testdata/types/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.field]]
rename = "explicitinttypeName"
path = "explicitinttype"
type = "int"
[[inputs.file.json_v2.field]]
rename = "uinttype"
path = "explicitinttype"
type = "uint"
[[inputs.file.json_v2.field]]
rename = "defaultinttypeName"
path = "defaultinttype"
[[inputs.file.json_v2.field]]
rename = "convertfloatointName"
path = "convertfloatoint"
type = "int"
[[inputs.file.json_v2.field]]
rename = "convertstringtointName"
path = "convertstringtoint"
type = "int"
[[inputs.file.json_v2.field]]
rename = "convertbooltointName"
path = "convertbooltoint"
type = "int"
# Parse float types from JSON
[[inputs.file]]
files = ["./testdata/types/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.field]]
rename = "explicitfloattypeName"
path = "explicitfloattype"
type = "float"
[[inputs.file.json_v2.field]]
rename = "defaultfloattypeName"
path = "defaultfloattype"
[[inputs.file.json_v2.field]]
rename = "convertintotfloatName"
path = "convertintotfloat"
type = "float"
[[inputs.file.json_v2.field]]
rename = "convertstringtofloatName"
path = "convertstringtofloat"
type = "float"
# Parse bool types from JSON
[[inputs.file]]
files = ["./testdata/types/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.field]]
rename = "explicitbooltypeName"
path = "explicitbooltype"
type = "bool"
[[inputs.file.json_v2.field]]
rename = "defaultbooltypeName"
path = "defaultbooltype"
[[inputs.file.json_v2.field]]
rename = "convertinttoboolName"
path = "convertinttobool"
type = "bool"
[[inputs.file.json_v2.field]]
rename = "convertstringtoboolName"
path = "convertstringtobool"
type = "bool"
[[inputs.file.json_v2.field]]
rename = "convertintstringtoboolTrueName"
path = "convertintstringtoboolTrue"
type = "bool"
[[inputs.file.json_v2.field]]
rename = "convertintstringtoboolFalseName"
path = "convertintstringtoboolFalse"
type = "bool"

View file

@ -0,0 +1,6 @@
the path "wrong" doesn't exist
the path "wrong" doesn't exist
the path "wrong" doesn't exist
the timestamp path "wrong" returned NULL
the path "wrong" doesn't exist
the path "wrong" doesn't exist

View file

@ -0,0 +1,3 @@
{
"correct": "test"
}

View file

@ -0,0 +1,46 @@
# Example taken from: https://github.com/influxdata/telegraf/issues/7097
[[inputs.file]]
files = ["./testdata/wrong_path/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "wrong"
[[inputs.file]]
files = ["./testdata/wrong_path/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "correct"
[[inputs.file.json_v2.object.tag]]
path = "wrong"
[[inputs.file]]
files = ["./testdata/wrong_path/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.object]]
path = "correct"
[[inputs.file.json_v2.object.field]]
path = "wrong"
[[inputs.file]]
files = ["./testdata/wrong_path/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
timestamp_path = "wrong"
[[inputs.file]]
files = ["./testdata/wrong_path/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.tag]]
path = "wrong"
[[inputs.file]]
files = ["./testdata/wrong_path/input.json"]
data_format = "json_v2"
[[inputs.file.json_v2]]
[[inputs.file.json_v2.field]]
path = "wrong"