logstash-filter-rest
logstash-filter-rest copied to clipboard
Documentation update : json configuration parameter
It is more a documentation improvement.
It was not obvious for me that the json
configuration parameter is meant to specify that the response is expecte to have a json format. What else could it be, will you ask...rather than having users to deduce it, it find it easier to use when it is written.
filter {
rest {
request => {
url => "http://example.com" # string (required, with field reference: "http://example.com?id=%{id}" or params, if defined)
method => "post" # string (optional, default = "get")
headers => { # hash (optional)
"key1" => "value1"
"key2" => "value2"
}
auth => {
user => "AzureDiamond"
password => "hunter2"
}
params => { # hash (optional, available for method => "get" and "post"; if post it will be transformed into body hash and posted as json)
"key1" => "value1"
"key2" => "value2"
"key3" => "%{somefield}" # sprintf is used implicitly
}
}
json => true # is json the format of the target ? boolean (optional, default = true)
target => "my_key" # string (mandatory, no default)
fallback => { # hash describing a default in case of error
"key1" => "value1"
"key2" => "value2"
}
}
}