Fix httpjson README

closes #947
This commit is contained in:
Cameron Sparr 2016-03-31 20:37:04 -06:00 committed by Michele Fadda
parent 4f5c0ef281
commit a58c36e7f5
1 changed files with 28 additions and 37 deletions

View File

@ -6,7 +6,7 @@ For example, if you have a service called _mycollector_, which has HTTP endpoint
plugin like this: plugin like this:
``` ```
[[httpjson.services]] [[inputs.httpjson]]
name = "mycollector" name = "mycollector"
servers = [ servers = [
@ -24,7 +24,7 @@ plugin like this:
You can also specify which keys from server response should be considered tags: You can also specify which keys from server response should be considered tags:
``` ```
[[httpjson.services]] [[inputs.httpjson]]
... ...
tag_keys = [ tag_keys = [
@ -36,10 +36,10 @@ You can also specify which keys from server response should be considered tags:
You can also specify additional request parameters for the service: You can also specify additional request parameters for the service:
``` ```
[[httpjson.services]] [[inputs.httpjson]]
... ...
[httpjson.services.parameters] [inputs.httpjson.parameters]
event_type = "cpu_spike" event_type = "cpu_spike"
threshold = "0.75" threshold = "0.75"
@ -48,10 +48,10 @@ You can also specify additional request parameters for the service:
You can also specify additional request header parameters for the service: You can also specify additional request header parameters for the service:
``` ```
[[httpjson.services]] [[inputs.httpjson]]
... ...
[httpjson.services.headers] [inputs.httpjson.headers]
X-Auth-Token = "my-xauth-token" X-Auth-Token = "my-xauth-token"
apiVersion = "v1" apiVersion = "v1"
``` ```
@ -61,17 +61,13 @@ You can also specify additional request header parameters for the service:
Let's say that we have a service named "mycollector" configured like this: Let's say that we have a service named "mycollector" configured like this:
``` ```
[httpjson] [[inputs.httpjson]]
[[httpjson.services]]
name = "mycollector" name = "mycollector"
servers = [ servers = [
"http://my.service.com/_stats" "http://my.service.com/_stats"
] ]
# HTTP method to use (case-sensitive) # HTTP method to use (case-sensitive)
method = "GET" method = "GET"
tag_keys = ["service"] tag_keys = ["service"]
``` ```
@ -102,24 +98,19 @@ There is also the option to collect JSON from multiple services, here is an
example doing that. example doing that.
``` ```
[httpjson] [[inputs.httpjson]]
[[httpjson.services]]
name = "mycollector1" name = "mycollector1"
servers = [ servers = [
"http://my.service1.com/_stats" "http://my.service1.com/_stats"
] ]
# HTTP method to use (case-sensitive) # HTTP method to use (case-sensitive)
method = "GET" method = "GET"
[[httpjson.services]] [[inputs.httpjson]]
name = "mycollector2" name = "mycollector2"
servers = [ servers = [
"http://service.net/json/stats" "http://service.net/json/stats"
] ]
# HTTP method to use (case-sensitive) # HTTP method to use (case-sensitive)
method = "POST" method = "POST"
``` ```