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
|
@ -0,0 +1 @@
|
|||
could not instantiate parser: invalid timestamp format 'unix_ps'
|
|
@ -0,0 +1,29 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/bad-timestamp-format/message.avro"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
||||
avro_timestamp = "timestamp"
|
||||
avro_timestamp_format = "unix_ps"
|
||||
avro_schema = '''
|
||||
{
|
||||
"type":"record",
|
||||
"name":"Value",
|
||||
"namespace":"com.example",
|
||||
"fields":[
|
||||
{
|
||||
"name":"tag",
|
||||
"type":"string"
|
||||
},
|
||||
{
|
||||
"name":"field",
|
||||
"type":"long"
|
||||
},
|
||||
{
|
||||
"name":"timestamp",
|
||||
"type":"long"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
1
plugins/parsers/avro/testcases/benchmark/expected.out
Normal file
1
plugins/parsers/avro/testcases/benchmark/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
benchmark,source=myhost,tags_platform=python,tags_sdkver=3.11.5 value=5.0 1653643421000000000
|
7
plugins/parsers/avro/testcases/benchmark/message.json
Normal file
7
plugins/parsers/avro/testcases/benchmark/message.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"timestamp": 1653643421,
|
||||
"value": 5,
|
||||
"source": "myhost",
|
||||
"tags_platform": "python",
|
||||
"tags_sdkver": "3.11.5"
|
||||
}
|
25
plugins/parsers/avro/testcases/benchmark/telegraf.conf
Normal file
25
plugins/parsers/avro/testcases/benchmark/telegraf.conf
Normal file
|
@ -0,0 +1,25 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/benchmark/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "benchmark"
|
||||
avro_tags = ["tags_platform", "tags_sdkver", "source"]
|
||||
avro_fields = ["value"]
|
||||
avro_timestamp = "timestamp"
|
||||
avro_timestamp_format = "unix"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "com.benchmark",
|
||||
"name": "benchmark",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "value", "type": "float", "doc": ""},
|
||||
{"name": "timestamp", "type": "long", "doc": ""},
|
||||
{"name": "tags_platform", "type": "string", "doc": ""},
|
||||
{"name": "tags_sdkver", "type": "string", "default": "", "doc": ""},
|
||||
{"name": "source", "type": "string", "default": "", "doc": ""}
|
||||
]
|
||||
}
|
||||
'''
|
4
plugins/parsers/avro/testcases/config-both/expected.err
Normal file
4
plugins/parsers/avro/testcases/config-both/expected.err
Normal file
|
@ -0,0 +1,4 @@
|
|||
could not instantiate parser: exactly one of 'schema_registry' or 'schema' must be specified
|
||||
|
||||
|
||||
|
0
plugins/parsers/avro/testcases/config-both/expected.out
Normal file
0
plugins/parsers/avro/testcases/config-both/expected.out
Normal file
0
plugins/parsers/avro/testcases/config-both/message.avro
Normal file
0
plugins/parsers/avro/testcases/config-both/message.avro
Normal file
28
plugins/parsers/avro/testcases/config-both/telegraf.conf
Normal file
28
plugins/parsers/avro/testcases/config-both/telegraf.conf
Normal file
|
@ -0,0 +1,28 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/config-both/message.avro"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
||||
avro_schema_registry = "https://localhost:8081"
|
||||
avro_schema = '''
|
||||
{
|
||||
"type":"record",
|
||||
"name":"Value",
|
||||
"namespace":"com.example",
|
||||
"fields":[
|
||||
{
|
||||
"name":"tag",
|
||||
"type":"string"
|
||||
},
|
||||
{
|
||||
"name":"field",
|
||||
"type":"long"
|
||||
},
|
||||
{
|
||||
"name":"timestamp",
|
||||
"type":"long"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1,2 @@
|
|||
could not instantiate parser: exactly one of 'schema_registry' or 'schema' must be specified
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/config-neither/message.avro"]
|
||||
data_format = "avro"
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
1
plugins/parsers/avro/testcases/enum/expected.out
Normal file
1
plugins/parsers/avro/testcases/enum/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
sensors,name=temperature value_int=42i,status="OK"
|
7
plugins/parsers/avro/testcases/enum/message.json
Normal file
7
plugins/parsers/avro/testcases/enum/message.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "temperature",
|
||||
"value": {
|
||||
"int": 42
|
||||
},
|
||||
"status": "OK"
|
||||
}
|
41
plugins/parsers/avro/testcases/enum/telegraf.conf
Normal file
41
plugins/parsers/avro/testcases/enum/telegraf.conf
Normal file
|
@ -0,0 +1,41 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/enum/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "sensors"
|
||||
avro_tags = ["name"]
|
||||
avro_fields = ["value", "status"]
|
||||
avro_field_separator = "_"
|
||||
avro_schema = '''
|
||||
{
|
||||
"type": "record",
|
||||
"name": "Metric",
|
||||
"fields": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": [
|
||||
"null",
|
||||
"int",
|
||||
"string"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "status",
|
||||
"type": {
|
||||
"type": "enum",
|
||||
"name": "Status",
|
||||
"symbols": [
|
||||
"UNKNOWN",
|
||||
"OK",
|
||||
"FAILURE"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
1
plugins/parsers/avro/testcases/json-array/expected.out
Normal file
1
plugins/parsers/avro/testcases/json-array/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
array,name=pi data_0=3,data_1=3.0999999046325684,data_2=3.140000104904175,data_3=3.1410000324249268 1682509200092000
|
5
plugins/parsers/avro/testcases/json-array/message.json
Normal file
5
plugins/parsers/avro/testcases/json-array/message.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"data": [ 3, 3.1, 3.14, 3.141 ],
|
||||
"name": "pi"
|
||||
}
|
24
plugins/parsers/avro/testcases/json-array/telegraf.conf
Normal file
24
plugins/parsers/avro/testcases/json-array/telegraf.conf
Normal file
|
@ -0,0 +1,24 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/json-array/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "array"
|
||||
avro_tags = ["name"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_fields = ["data"]
|
||||
avro_field_separator = "_"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "constants",
|
||||
"name": "classical",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "name", "type": "string"},
|
||||
{"name": "data", "type": "array", "items": "float"},
|
||||
{"name": "statistics_collection_time", "type": "long"}
|
||||
]
|
||||
}
|
||||
'''
|
1
plugins/parsers/avro/testcases/json-format/expected.out
Normal file
1
plugins/parsers/avro/testcases/json-format/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
Switch,switch_wwn=10:00:50:EB:1A:0B:84:3A up_time=1166984904i,cpu_utilization=14.0,memory_utilization=20.0 1682509200092000
|
7
plugins/parsers/avro/testcases/json-format/message.json
Normal file
7
plugins/parsers/avro/testcases/json-format/message.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"switch_wwn": "10:00:50:EB:1A:0B:84:3A",
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"up_time": 1166984904,
|
||||
"cpu_utilization": 14.0,
|
||||
"memory_utilization": 20.0
|
||||
}
|
25
plugins/parsers/avro/testcases/json-format/telegraf.conf
Normal file
25
plugins/parsers/avro/testcases/json-format/telegraf.conf
Normal file
|
@ -0,0 +1,25 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/json-format/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "Switch"
|
||||
avro_tags = ["switch_wwn"]
|
||||
avro_fields = ["up_time", "cpu_utilization", "memory_utilization"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "com.brocade.streaming",
|
||||
"name": "fibrechannel_switch_statistics",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "switch_wwn", "type": "string", "doc": "WWN of the Physical Switch."},
|
||||
{"name": "statistics_collection_time", "type": "long", "doc": "Epoch time when statistics is collected."},
|
||||
{"name": "up_time", "type": "long", "doc": "Switch Up Time (in hundredths of a second)"},
|
||||
{"name": "cpu_utilization", "type": "float", "default": 0, "doc": "CPU Utilization in %"},
|
||||
{"name": "memory_utilization", "type": "float", "default": 0, "doc": "Memory Utilization in %"}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
cpu_load,Server=test_server Value=18.7 1694526986671
|
|
@ -0,0 +1 @@
|
|||
ÞæîšÑbtest_server33333³2@cpu_load
|
|
@ -0,0 +1,30 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/measurement_name_from_message/message.avro"]
|
||||
data_format = "avro"
|
||||
avro_measurement_field = "Measurement"
|
||||
avro_tags = [ "Server" ]
|
||||
avro_fields = [ "Value" ]
|
||||
avro_schema = '''
|
||||
{
|
||||
"type": "record",
|
||||
"name": "TestRecord",
|
||||
"fields": [
|
||||
{
|
||||
"name": "ServerTs",
|
||||
"type": "long"
|
||||
},
|
||||
{
|
||||
"name": "Server",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "Value",
|
||||
"type": "double"
|
||||
},
|
||||
{
|
||||
"name": "Measurement",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
measurement,tag=test_tag field=19i,timestamp=1664296121000000i 1664296121000000
|
|
@ -0,0 +1 @@
|
|||
test_tag&€<>¿±äêô
|
|
@ -0,0 +1,28 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/no-timestamp-format/message.avro"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
||||
avro_timestamp = "timestamp"
|
||||
avro_schema = '''
|
||||
{
|
||||
"type":"record",
|
||||
"name":"Value",
|
||||
"namespace":"com.example",
|
||||
"fields":[
|
||||
{
|
||||
"name":"tag",
|
||||
"type":"string"
|
||||
},
|
||||
{
|
||||
"name":"field",
|
||||
"type":"long"
|
||||
},
|
||||
{
|
||||
"name":"timestamp",
|
||||
"type":"long"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
measurement,tag=test_tag field=19i,timestamp=1664296121000000i 1664296121000000
|
|
@ -0,0 +1 @@
|
|||
test_tag&€<>¿±äêô
|
|
@ -0,0 +1,28 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/supplied_timestamp/message.avro"]
|
||||
data_format = "avro"
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
||||
avro_timestamp = "timestamp"
|
||||
avro_timestamp_format = "unix_us"
|
||||
avro_schema = '''
|
||||
{
|
||||
"type":"record",
|
||||
"name":"Value",
|
||||
"namespace":"com.example",
|
||||
"fields":[
|
||||
{
|
||||
"name":"tag",
|
||||
"type":"string"
|
||||
},
|
||||
{
|
||||
"name":"field",
|
||||
"type":"long"
|
||||
},
|
||||
{
|
||||
"name":"timestamp",
|
||||
"type":"long"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
measurement,tag=test_tag field=19i,timestamp=1664296121000000i 1664296121000000
|
|
@ -0,0 +1 @@
|
|||
test_tag&€<>¿±äêô
|
|
@ -0,0 +1,29 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/supplied_timestamp_fields_specified/message.avro"]
|
||||
data_format = "avro"
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
||||
avro_fields = [ "field", "timestamp"]
|
||||
avro_timestamp = "timestamp"
|
||||
avro_timestamp_format = "unix_us"
|
||||
avro_schema = '''
|
||||
{
|
||||
"type":"record",
|
||||
"name":"Value",
|
||||
"namespace":"com.example",
|
||||
"fields":[
|
||||
{
|
||||
"name":"tag",
|
||||
"type":"string"
|
||||
},
|
||||
{
|
||||
"name":"field",
|
||||
"type":"long"
|
||||
},
|
||||
{
|
||||
"name":"timestamp",
|
||||
"type":"long"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
measurement,tag=test_tag field=19i 1664296121000000
|
|
@ -0,0 +1 @@
|
|||
test_tag&€<>¿±äêô
|
|
@ -0,0 +1,23 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/supplied_timestamp_fields_unspecified/message.avro"]
|
||||
data_format = "avro"
|
||||
avro_measurement = "measurement"
|
||||
avro_tags = [ "tag" ]
|
||||
avro_fields = [ "field" ]
|
||||
avro_schema = '''
|
||||
{
|
||||
"type":"record",
|
||||
"name":"Value",
|
||||
"namespace":"com.example",
|
||||
"fields":[
|
||||
{
|
||||
"name":"tag",
|
||||
"type":"string"
|
||||
},
|
||||
{
|
||||
"name":"field",
|
||||
"type":"long"
|
||||
}
|
||||
]
|
||||
}
|
||||
'''
|
1
plugins/parsers/avro/testcases/union-any/expected.out
Normal file
1
plugins/parsers/avro/testcases/union-any/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
Switch,switch_wwn=10:00:50:EB:1A:0B:84:3A statistics_collection_time=1682509200092i,up_time=1166984904i,cpu_utilization=11i,memory_utilization=20.0 1682509200092000
|
11
plugins/parsers/avro/testcases/union-any/message.json
Normal file
11
plugins/parsers/avro/testcases/union-any/message.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"switch_wwn": "10:00:50:EB:1A:0B:84:3A",
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"up_time": 1166984904,
|
||||
"cpu_utilization": {
|
||||
"int": 11
|
||||
},
|
||||
"memory_utilization": {
|
||||
"float": 20.0
|
||||
}
|
||||
}
|
26
plugins/parsers/avro/testcases/union-any/telegraf.conf
Normal file
26
plugins/parsers/avro/testcases/union-any/telegraf.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/union-any/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "Switch"
|
||||
avro_tags = ["switch_wwn"]
|
||||
avro_fields = ["up_time", "cpu_utilization", "memory_utilization", "statistics_collection_time"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_union_mode = "any"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "com.brocade.streaming",
|
||||
"name": "fibrechannel_switch_statistics",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "switch_wwn", "type": "string", "doc": "WWN of the Physical Switch."},
|
||||
{"name": "statistics_collection_time", "type": "long", "doc": "Epoch time when statistics is collected."},
|
||||
{"name": "up_time", "type": "long", "doc": "Switch Up Time (in hundredths of a second)"},
|
||||
{"name": "cpu_utilization", "type": ["null", "float", "int"], "default": null, "doc": "CPU Utilization in %"},
|
||||
{"name": "memory_utilization", "type": ["null", "float"], "doc": "Memory Utilization in %"}
|
||||
]
|
||||
}
|
||||
'''
|
1
plugins/parsers/avro/testcases/union-array/expected.out
Normal file
1
plugins/parsers/avro/testcases/union-array/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
array,name=pi data_0=3,data_1=3.0999999046325684,data_2=3.140000104904175,data_3=3.1410000324249268 1682509200092000
|
5
plugins/parsers/avro/testcases/union-array/message.json
Normal file
5
plugins/parsers/avro/testcases/union-array/message.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"data": [ 3, 3.1, 3.14, 3.141 ],
|
||||
"name": "pi"
|
||||
}
|
25
plugins/parsers/avro/testcases/union-array/telegraf.conf
Normal file
25
plugins/parsers/avro/testcases/union-array/telegraf.conf
Normal file
|
@ -0,0 +1,25 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/union-array/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "array"
|
||||
avro_tags = ["name"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_fields = ["data"]
|
||||
avro_union_mode = "any"
|
||||
avro_field_separator = "_"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "constants",
|
||||
"name": "classical",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "name", "type": "string"},
|
||||
{"name": "data", "type": "array", "items": "float"},
|
||||
{"name": "statistics_collection_time", "type": "long"}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
Switch,switch_wwn=10:00:50:EB:1A:0B:84:3A,some_union_in_a_tag=some_value statistics_collection_time=1682509200092i,up_time=1166984904i,memory_utilization=20.0 1682509200092000
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"some_union_in_a_tag": {
|
||||
"string": "some_value"
|
||||
},
|
||||
"switch_wwn": "10:00:50:EB:1A:0B:84:3A",
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"up_time": 1166984904,
|
||||
"cpu_utilization": {
|
||||
"null": null
|
||||
},
|
||||
"memory_utilization": {
|
||||
"float": 20.0
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/union-nullable-tag/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "Switch"
|
||||
avro_tags = ["switch_wwn", "some_union_in_a_tag"]
|
||||
avro_fields = ["up_time", "cpu_utilization", "memory_utilization", "statistics_collection_time"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_union_mode = "nullable"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "com.brocade.streaming",
|
||||
"name": "fibrechannel_switch_statistics",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "some_union_in_a_tag", "type": ["null", "string"], "default": null, "doc": "Some union that is used in a tag"},
|
||||
{"name": "switch_wwn", "type": "string", "doc": "WWN of the Physical Switch."},
|
||||
{"name": "statistics_collection_time", "type": "long", "doc": "Epoch time when statistics is collected."},
|
||||
{"name": "up_time", "type": "long", "doc": "Switch Up Time (in hundredths of a second)"},
|
||||
{"name": "cpu_utilization", "type": ["null","float"], "default": null, "doc": "CPU Utilization in %"},
|
||||
{"name": "memory_utilization", "type": ["null", "float"], "default": null, "doc": "Memory Utilization in %"}
|
||||
]
|
||||
}
|
||||
'''
|
|
@ -0,0 +1 @@
|
|||
Switch,switch_wwn=10:00:50:EB:1A:0B:84:3A statistics_collection_time=1682509200092i,up_time=1166984904i,memory_utilization=20.0 1682509200092000
|
11
plugins/parsers/avro/testcases/union-nullable/message.json
Normal file
11
plugins/parsers/avro/testcases/union-nullable/message.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"switch_wwn": "10:00:50:EB:1A:0B:84:3A",
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"up_time": 1166984904,
|
||||
"cpu_utilization": {
|
||||
"null": null
|
||||
},
|
||||
"memory_utilization": {
|
||||
"float": 20.0
|
||||
}
|
||||
}
|
26
plugins/parsers/avro/testcases/union-nullable/telegraf.conf
Normal file
26
plugins/parsers/avro/testcases/union-nullable/telegraf.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/union-nullable/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "Switch"
|
||||
avro_tags = ["switch_wwn"]
|
||||
avro_fields = ["up_time", "cpu_utilization", "memory_utilization", "statistics_collection_time"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_union_mode = "nullable"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "com.brocade.streaming",
|
||||
"name": "fibrechannel_switch_statistics",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "switch_wwn", "type": "string", "doc": "WWN of the Physical Switch."},
|
||||
{"name": "statistics_collection_time", "type": "long", "doc": "Epoch time when statistics is collected."},
|
||||
{"name": "up_time", "type": "long", "doc": "Switch Up Time (in hundredths of a second)"},
|
||||
{"name": "cpu_utilization", "type": ["null","float"], "default": null, "doc": "CPU Utilization in %"},
|
||||
{"name": "memory_utilization", "type": ["null", "float"], "default": null, "doc": "Memory Utilization in %"}
|
||||
]
|
||||
}
|
||||
'''
|
1
plugins/parsers/avro/testcases/union/expected.out
Normal file
1
plugins/parsers/avro/testcases/union/expected.out
Normal file
|
@ -0,0 +1 @@
|
|||
Switch,switch_wwn=10:00:50:EB:1A:0B:84:3A statistics_collection_time=1682509200092i,up_time=1166984904i,memory_utilization_float=20.0 1682509200092000
|
11
plugins/parsers/avro/testcases/union/message.json
Normal file
11
plugins/parsers/avro/testcases/union/message.json
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"switch_wwn": "10:00:50:EB:1A:0B:84:3A",
|
||||
"statistics_collection_time": 1682509200092,
|
||||
"up_time": 1166984904,
|
||||
"cpu_utilization": {
|
||||
"null": null
|
||||
},
|
||||
"memory_utilization": {
|
||||
"float": 20.0
|
||||
}
|
||||
}
|
26
plugins/parsers/avro/testcases/union/telegraf.conf
Normal file
26
plugins/parsers/avro/testcases/union/telegraf.conf
Normal file
|
@ -0,0 +1,26 @@
|
|||
[[ inputs.file ]]
|
||||
files = ["./testcases/union/message.json"]
|
||||
data_format = "avro"
|
||||
|
||||
avro_format = "json"
|
||||
avro_measurement = "Switch"
|
||||
avro_tags = ["switch_wwn"]
|
||||
avro_fields = ["up_time", "cpu_utilization", "memory_utilization", "statistics_collection_time"]
|
||||
avro_timestamp = "statistics_collection_time"
|
||||
avro_timestamp_format = "unix_ms"
|
||||
avro_field_separator = "_"
|
||||
avro_schema = '''
|
||||
{
|
||||
"namespace": "com.brocade.streaming",
|
||||
"name": "fibrechannel_switch_statistics",
|
||||
"type": "record",
|
||||
"version": "1",
|
||||
"fields": [
|
||||
{"name": "switch_wwn", "type": "string", "doc": "WWN of the Physical Switch."},
|
||||
{"name": "statistics_collection_time", "type": "long", "doc": "Epoch time when statistics is collected."},
|
||||
{"name": "up_time", "type": "long", "doc": "Switch Up Time (in hundredths of a second)"},
|
||||
{"name": "cpu_utilization", "type": ["null", "float"], "default": null, "doc": "CPU Utilization in %"},
|
||||
{"name": "memory_utilization", "type": ["null", "float"], "default": null, "doc": "Memory Utilization in %"}
|
||||
]
|
||||
}
|
||||
'''
|
Loading…
Add table
Add a link
Reference in a new issue