This output lets you send events to a generic HTTP(S) endpoint.
This output will execute up to 'pool_max' requests in parallel for performance. Consider this when tuning this plugin for performance.
Additionally, note that when parallel execution is used strict ordering of events is not guaranteed!
Beware, to use codecs, please use the 'format' option for now.
This plugin supports the following configuration options plus the [plugins-outputs-http-common-options] described later.
Setting | Input type | Required |
---|---|---|
No |
||
a valid filesystem path |
No |
|
a valid filesystem path |
No |
|
a valid filesystem path |
No |
|
No |
||
No |
||
No |
||
No |
||
string, one of |
No |
|
No |
||
No |
||
string, one of |
Yes |
|
No |
||
No |
||
a valid filesystem path |
No |
|
No |
||
No |
||
No |
||
No |
||
No |
||
No |
||
<<,>> |
No |
|
No |
||
No |
||
No |
||
No |
||
No |
||
a valid filesystem path |
No |
|
No |
||
No |
||
Yes |
||
No |
Also see [plugins-outputs-http-common-options] for a list of options supported by all output plugins.
-
Value type is number
-
Default value is
1
How many times should the client retry a failing URL. We highly recommend NOT setting this value
to zero if keepalive is enabled. Some servers incorrectly end keepalives early requiring a retry!
Only IO related failures will be retried, such as connection timeouts and unreachable hosts.
Valid but non 2xx HTTP responses will always be retried, regardless of the value of this setting,
unless retry_failed
is set.
Note: if retry_non_idempotent
is NOT set only GET, HEAD, PUT, DELETE, OPTIONS, and TRACE requests will be retried.
-
Value type is path
-
There is no default value for this setting.
If you need to use a custom X.509 CA (.pem certs) specify the path to that here
-
Value type is path
-
There is no default value for this setting.
If you’d like to use a client certificate (note, most people don’t want this) set the path to the x509 cert here
-
Value type is path
-
There is no default value for this setting.
If you’re using a client certificate specify the path to the encryption key here
-
Value type is number
-
Default value is
10
Timeout (in seconds) to wait for a connection to be established. Default is 10s
-
Value type is string
-
There is no default value for this setting.
Content type
If not specified, this defaults to the following:
-
if format is "json", "application/json"
-
if format is "json_batch", "application/json". Each Logstash batch of events will be concatenated into a single array and sent in one request.
-
if format is "form", "application/x-www-form-urlencoded"
-
if format is "codec", "text/xml"
-
Value type is boolean
-
Default value is
true
Enable cookie support. With this enabled the client will persist cookies across requests as a normal web browser would. Enabled by default
-
Value type is boolean
-
Default value is
true
Should redirects be followed? Defaults to true
-
Value can be any of:
json
,json_batch
,form
,message
,codec
-
Default value is
"json"
Set the format of the http body.
If json_batch, each batch of events received by this output will be placed into a single JSON array and sent in one request. This is particularly useful for high throughput scenarios such as sending data between Logstash instaces.
If form, then the body will be the mapping (or whole event) converted
into a query parameter string, e.g. foo=bar&baz=fizz…
If message, then the body will be the result of formatting the event according to message
If codec, then the body will be the result of executing the specified codec
Otherwise, the event is sent as json.
-
Value type is hash
-
There is no default value for this setting.
Custom headers to use
format is headers ⇒ ["X-My-Header", "%{host}"]
-
Value type is boolean
-
Default value is
false
Enable request compression support. With this enabled the plugin will compress http requests using gzip.
-
This is a required setting.
-
Value can be any of:
put
,post
,patch
,delete
,get
,head
-
There is no default value for this setting.
The HTTP Verb. One of "put", "post", "patch", "delete", "get", "head"
-
Value type is number
-
There is no default value for this setting.
If you would like to consider some non-2xx codes to be successes enumerate them here. Responses returning these codes will be considered successes
-
Value type is boolean
-
Default value is
true
Turn this on to enable HTTP keepalive support. We highly recommend setting automatic_retries
to at least
one with this to fix interactions with broken keepalive implementations.
-
Value type is path
-
There is no default value for this setting.
If you need to use a custom keystore (.jks
) specify that here. This does not work with .pem keys!
-
Value type is password
-
There is no default value for this setting.
Specify the keystore password here. Note, most .jks files created with keytool require a password!
-
Value type is string
-
Default value is
"JKS"
Specify the keystore type here. One of JKS
or PKCS12
. Default is JKS
-
Value type is hash
-
There is no default value for this setting.
This lets you choose the structure and parts of the event that are sent.
For example:
mapping => {"foo" => "%{host}"
"bar" => "%{type}"}
-
Value type is string
-
There is no default value for this setting.
-
Value type is number
-
Default value is
50
Max number of concurrent connections. Defaults to 50
-
Value type is number
-
Default value is
25
Max number of concurrent connections to a single host. Defaults to 25
-
Value type is string
-
There is no default value for this setting.
If you’d like to use an HTTP proxy . This supports multiple configuration syntaxes:
-
Proxy host in form:
http://proxy.org:1234
-
Proxy host in form:
{host ⇒ "proxy.org", port ⇒ 80, scheme ⇒ 'http', user ⇒ 'username@host', password ⇒ 'password'}
-
Proxy host in form:
{url ⇒ 'http://proxy.org:1234', user ⇒ 'username@host', password ⇒ 'password'}
-
Value type is number
-
Default value is
60
This module makes it easy to add a very fully configured HTTP client to logstash based on [Manticore](https://github.com/cheald/manticore). For an example of its usage see https://github.com/logstash-plugins/logstash-input-http_poller Timeout (in seconds) for the entire request
-
Value type is boolean
-
Default value is
true
Set this to false if you don’t want this output to retry failed requests
-
Value type is boolean
-
Default value is
false
If automatic_retries
is enabled this will cause non-idempotent HTTP verbs (such as POST) to be retried.
This only affects connectivity related errors (see related automatic_retries
setting).
-
Value type is number
-
Default value is
[429, 500, 502, 503, 504]
If encountered as response codes this plugin will retry these requests
-
Value type is number
-
Default value is
10
Timeout (in seconds) to wait for data on the socket. Default is 10s
-
Value type is path
-
There is no default value for this setting.
If you need to use a custom truststore (.jks
) specify that here. This does not work with .pem certs!
-
Value type is password
-
There is no default value for this setting.
Specify the truststore password here. Note, most .jks files created with keytool require a password!
-
Value type is string
-
Default value is
"JKS"
Specify the truststore type here. One of JKS
or PKCS12
. Default is JKS
-
This is a required setting.
-
Value type is string
-
There is no default value for this setting.
URL to use
-
Value type is number
-
Default value is
200
How long to wait before checking if the connection is stale before executing a request on a connection using keepalive. You may want to set this lower, possibly to 0 if you get connection errors regularly Quoting the Apache commons docs (this client is based Apache Commmons): 'Defines period of inactivity in milliseconds after which persistent connections must be re-validated prior to being leased to the consumer. Non-positive value passed to this method disables connection validation. This check helps detect connections that have become stale (half-closed) while kept inactive in the pool.' See these docs for more info