From f804d6395e1c0b37b15837efa12de2f92299d68f Mon Sep 17 00:00:00 2001 From: Sven Rebhan <36194019+srebhan@users.noreply.github.com> Date: Wed, 26 Jul 2023 19:02:03 +0200 Subject: [PATCH] chore(deps): Bump github.com/antchfx/xpath from v1.2.4 to latest master (#13679) --- go.mod | 2 +- go.sum | 3 ++- .../xpath/testcases/string_join/expected.out | 1 + .../xpath/testcases/string_join/telegraf.conf | 13 ++++++++++++ .../xpath/testcases/string_join/test.json | 20 +++++++++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 plugins/parsers/xpath/testcases/string_join/expected.out create mode 100644 plugins/parsers/xpath/testcases/string_join/telegraf.conf create mode 100644 plugins/parsers/xpath/testcases/string_join/test.json diff --git a/go.mod b/go.mod index 6953ae525..8d752bc5c 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( github.com/amir/raidman v0.0.0-20170415203553-1ccc43bfb9c9 github.com/antchfx/jsonquery v1.3.3 github.com/antchfx/xmlquery v1.3.17 - github.com/antchfx/xpath v1.2.4 + github.com/antchfx/xpath v1.2.5-0.20230505064641-588960cceeac github.com/apache/arrow/go/v13 v13.0.0-20230630125530-5a06b2ec2a8e github.com/apache/iotdb-client-go v0.12.2-0.20220722111104-cd17da295b46 github.com/apache/thrift v0.18.1 diff --git a/go.sum b/go.sum index 60cc084f2..01bf06f94 100644 --- a/go.sum +++ b/go.sum @@ -188,8 +188,9 @@ github.com/antchfx/xmlquery v1.3.17 h1:d0qWjPp/D+vtRw7ivCwT5ApH/3CkQU8JOeo3245Pp github.com/antchfx/xmlquery v1.3.17/go.mod h1:Afkq4JIeXut75taLSuI31ISJ/zeq+3jG7TunF7noreA= github.com/antchfx/xpath v1.1.7/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= github.com/antchfx/xpath v1.2.3/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= -github.com/antchfx/xpath v1.2.4 h1:dW1HB/JxKvGtJ9WyVGJ0sIoEcqftV3SqIstujI+B9XY= github.com/antchfx/xpath v1.2.4/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= +github.com/antchfx/xpath v1.2.5-0.20230505064641-588960cceeac h1:Et7H7mEPWuivbFEXi3dWa8hobnvF380TS2mq7JmgjEI= +github.com/antchfx/xpath v1.2.5-0.20230505064641-588960cceeac/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= diff --git a/plugins/parsers/xpath/testcases/string_join/expected.out b/plugins/parsers/xpath/testcases/string_join/expected.out new file mode 100644 index 000000000..68cc9ca8a --- /dev/null +++ b/plugins/parsers/xpath/testcases/string_join/expected.out @@ -0,0 +1 @@ +foo cpus="cpu1;cpu2;cpu3" 1690218699000000000 \ No newline at end of file diff --git a/plugins/parsers/xpath/testcases/string_join/telegraf.conf b/plugins/parsers/xpath/testcases/string_join/telegraf.conf new file mode 100644 index 000000000..dc0201b65 --- /dev/null +++ b/plugins/parsers/xpath/testcases/string_join/telegraf.conf @@ -0,0 +1,13 @@ +[[inputs.file]] + files = ["./testcases/string_join/test.json"] + data_format = "xpath_json" + + xpath_native_types = true + + [[inputs.file.xpath]] + metric_name = "'foo'" + timestamp = "//timestamp" + timestamp_format = "unix" + + [inputs.file.xpath.fields] + cpus = "string-join(//cpus/*, ';')" \ No newline at end of file diff --git a/plugins/parsers/xpath/testcases/string_join/test.json b/plugins/parsers/xpath/testcases/string_join/test.json new file mode 100644 index 000000000..dd52a9082 --- /dev/null +++ b/plugins/parsers/xpath/testcases/string_join/test.json @@ -0,0 +1,20 @@ +{ + "name": "PC1", + "cpus": [ + "cpu1", + "cpu2", + "cpu3" + ], + "disks": { + "sata": [ + "disk1", + "disk2" + ], + "nvme": [ + "disk3", + "disk4", + "disk5" + ] + }, + "timestamp": 1690218699 + } \ No newline at end of file