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
5
migrations/inputs_httpjson/testcases/array/expected.conf
Normal file
5
migrations/inputs_httpjson/testcases/array/expected.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
[[inputs.http]]
|
||||
name_override = "httpjson"
|
||||
urls = ["http://localhost:9999/stats/"]
|
||||
data_format = "json"
|
||||
tag_keys = ["service"]
|
20
migrations/inputs_httpjson/testcases/array/input.json
Normal file
20
migrations/inputs_httpjson/testcases/array/input.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
[
|
||||
{
|
||||
"service": "service01",
|
||||
"a": 0.5,
|
||||
"b": {
|
||||
"c": "some text",
|
||||
"d": 0.1,
|
||||
"e": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"service": "service02",
|
||||
"a": 0.6,
|
||||
"b": {
|
||||
"c": "some text",
|
||||
"d": 0.2,
|
||||
"e": 6
|
||||
}
|
||||
}
|
||||
]
|
2
migrations/inputs_httpjson/testcases/array/output.influx
Normal file
2
migrations/inputs_httpjson/testcases/array/output.influx
Normal file
|
@ -0,0 +1,2 @@
|
|||
httpjson,url=http://localhost:9999/stats/,service=service01 a=0.5,b_d=0.1,b_e=5
|
||||
httpjson,url=http://localhost:9999/stats/,service=service02 a=0.6,b_d=0.2,b_e=6
|
3
migrations/inputs_httpjson/testcases/array/telegraf.conf
Normal file
3
migrations/inputs_httpjson/testcases/array/telegraf.conf
Normal file
|
@ -0,0 +1,3 @@
|
|||
[[inputs.httpjson]]
|
||||
servers = ["http://localhost:9999/stats/"]
|
||||
tag_keys = ["service"]
|
|
@ -0,0 +1,8 @@
|
|||
[[inputs.http]]
|
||||
data_format = "json"
|
||||
fieldinclude = ["a"]
|
||||
name_override = "httpjson"
|
||||
urls = ["http://localhost:9999/stats/"]
|
||||
|
||||
[inputs.http.tags]
|
||||
foo = "bar"
|
|
@ -0,0 +1,6 @@
|
|||
[[inputs.httpjson]]
|
||||
servers = ["http://localhost:9999/stats/"]
|
||||
fieldpass = ["a"]
|
||||
|
||||
[inputs.httpjson.tags]
|
||||
foo = "bar"
|
|
@ -0,0 +1,8 @@
|
|||
[[inputs.http]]
|
||||
name_override = "httpjson"
|
||||
method = "POST"
|
||||
urls = ["http://localhost:9999/stats"]
|
||||
data_format = "json"
|
||||
[inputs.http.headers]
|
||||
X-Auth-Token = "my-xauth-token"
|
||||
apiVersion = "v1"
|
|
@ -0,0 +1,6 @@
|
|||
[[inputs.httpjson]]
|
||||
servers = ["http://localhost:9999/stats"]
|
||||
method = "POST"
|
||||
[inputs.httpjson.headers]
|
||||
X-Auth-Token = "my-xauth-token"
|
||||
apiVersion = "v1"
|
|
@ -0,0 +1,4 @@
|
|||
[[inputs.http]]
|
||||
name_override = "httpjson"
|
||||
urls = ["http://localhost:9999/stats?event_type=cpu_spike&threshold=0.75"]
|
||||
data_format = "json"
|
|
@ -0,0 +1,8 @@
|
|||
[[inputs.httpjson]]
|
||||
servers = ["http://localhost:9999/stats"]
|
||||
# HTTP Request Parameters (all values must be strings). For "GET" requests, data
|
||||
# will be included in the query. For "POST" requests, data will be included
|
||||
# in the request body as "x-www-form-urlencoded".
|
||||
[inputs.httpjson.parameters]
|
||||
event_type = "cpu_spike"
|
||||
threshold = "0.75"
|
|
@ -0,0 +1,5 @@
|
|||
[[inputs.http]]
|
||||
name_override = "webserver_stats"
|
||||
timeout = "5s"
|
||||
urls = ["http://localhost:9999/stats/", "http://localhost:9998/stats/"]
|
||||
data_format = "json"
|
9
migrations/inputs_httpjson/testcases/single/input.json
Normal file
9
migrations/inputs_httpjson/testcases/single/input.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"a": 0.5,
|
||||
"b": {
|
||||
"c": "some text",
|
||||
"d": 0.1,
|
||||
"e": 5
|
||||
},
|
||||
"service": "service01"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
webserver_stats,url=http://localhost:9999/stats/ b_d=0.1,a=0.5,b_e=5
|
46
migrations/inputs_httpjson/testcases/single/telegraf.conf
Normal file
46
migrations/inputs_httpjson/testcases/single/telegraf.conf
Normal file
|
@ -0,0 +1,46 @@
|
|||
# Read flattened metrics from one or more JSON HTTP endpoints
|
||||
[[inputs.httpjson]]
|
||||
## NOTE This plugin only reads numerical measurements, strings and booleans
|
||||
## will be ignored.
|
||||
|
||||
## Name for the service being polled. Will be appended to the name of the
|
||||
## measurement e.g. "httpjson_webserver_stats".
|
||||
##
|
||||
## Deprecated (1.3.0): Use name_override, name_suffix, name_prefix instead.
|
||||
name = "webserver_stats"
|
||||
|
||||
## URL of each server in the service's cluster
|
||||
servers = [
|
||||
"http://localhost:9999/stats/",
|
||||
"http://localhost:9998/stats/",
|
||||
]
|
||||
## Set response_timeout (default 5 seconds)
|
||||
response_timeout = "5s"
|
||||
|
||||
## HTTP method to use: GET or POST (case-sensitive)
|
||||
method = "GET"
|
||||
|
||||
## Tags to extract from top-level of JSON server response.
|
||||
# tag_keys = [
|
||||
# "my_tag_1",
|
||||
# "my_tag_2"
|
||||
# ]
|
||||
|
||||
## Optional TLS Config
|
||||
# tls_ca = "/etc/telegraf/ca.pem"
|
||||
# tls_cert = "/etc/telegraf/cert.pem"
|
||||
# tls_key = "/etc/telegraf/key.pem"
|
||||
## Use TLS but skip chain & host verification
|
||||
# insecure_skip_verify = false
|
||||
|
||||
## HTTP Request Parameters (all values must be strings). For "GET" requests, data
|
||||
## will be included in the query. For "POST" requests, data will be included
|
||||
## in the request body as "x-www-form-urlencoded".
|
||||
# [inputs.httpjson.parameters]
|
||||
# event_type = "cpu_spike"
|
||||
# threshold = "0.75"
|
||||
|
||||
## HTTP Request Headers (all values must be strings).
|
||||
# [inputs.httpjson.headers]
|
||||
# X-Auth-Token = "my-xauth-token"
|
||||
# apiVersion = "v1"
|
Loading…
Add table
Add a link
Reference in a new issue