httpedit

  • Version: 3.1.1
  • Released on: 2016-07-14
  • Changelog
  • Compatible: 5.1.1.1, 5.0.0, 2.4.1, 2.4.0, 2.3.4

We count outstanding requests with this queue This queue tracks the requests to create backpressure When this queue is empty no new requests may be sent, tokens must be added back by the client on success

 

Synopsisedit

This plugin supports the following configuration options:

Required configuration options:

http {
    http_method => ...
    url => ...
}

Available configuration options:

Setting Input type Required Default value

automatic_retries

number

No

1

cacert

a valid filesystem path

No

client_cert

a valid filesystem path

No

client_key

a valid filesystem path

No

codec

codec

No

"plain"

connect_timeout

number

No

10

content_type

string

No

cookies

boolean

No

true

enable_metric

boolean

No

true

follow_redirects

boolean

No

true

format

string, one of ["json", "form", "message"]

No

"json"

headers

hash

No

http_method

string, one of ["put", "post", "patch", "delete", "get", "head"]

Yes

id

string

No

keepalive

boolean

No

true

keystore

a valid filesystem path

No

keystore_password

password

No

keystore_type

string

No

"JKS"

mapping

hash

No

message

string

No

pool_max

number

No

50

pool_max_per_route

number

No

25

proxy

<<,>>

No

request_timeout

number

No

60

retry_non_idempotent

boolean

No

false

socket_timeout

number

No

10

ssl_certificate_validation

boolean

No

true

truststore

a valid filesystem path

No

truststore_password

password

No

truststore_type

string

No

"JKS"

url

string

Yes

validate_after_inactivity

number

No

200

workers

<<,>>

No

1

Detailsedit

 

automatic_retriesedit

  • 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! Note: if retry_non_idempotent is set only GET, HEAD, PUT, DELETE, OPTIONS, and TRACE requests will be retried.

cacertedit

  • 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

client_certedit

  • 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

client_keyedit

  • 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

codecedit

  • Value type is codec
  • Default value is "plain"

The codec used for output data. Output codecs are a convenient method for encoding your data before it leaves the output, without needing a separate filter in your Logstash pipeline.

connect_timeoutedit

  • Value type is number
  • Default value is 10

Timeout (in seconds) to wait for a connection to be established. Default is 10s

content_typeedit

  • 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 "form", "application/x-www-form-urlencoded"

cookiesedit

  • 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

enable_metricedit

  • Value type is boolean
  • Default value is true

Disable or enable metric logging for this specific plugin instance by default we record all the metrics we can, but you can disable metrics collection for a specific plugin.

follow_redirectsedit

  • Value type is boolean
  • Default value is true

Should redirects be followed? Defaults to true

formatedit

  • Value can be any of: json, form, message
  • Default value is "json"

Set the format of the http body.

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

Otherwise, the event is sent as json.

headersedit

  • Value type is hash
  • There is no default value for this setting.

Custom headers to use format is headers => ["X-My-Header", "%{host}"]

http_methodedit

  • 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"

idedit

  • Value type is string
  • There is no default value for this setting.

Add a unique ID to the plugin instance, this ID is used for tracking information for a specific configuration of the plugin.

output {
 stdout {
   id => "ABC"
 }
}

If you don’t explicitely set this variable Logstash will generate a unique name.

keepaliveedit

  • 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.

keystoreedit

  • 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!

keystore_passwordedit

  • 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!

keystore_typeedit

  • Value type is string
  • Default value is "JKS"

Specify the keystore type here. One of JKS or PKCS12. Default is JKS

mappingedit

  • 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}"}

messageedit

  • Value type is string
  • There is no default value for this setting.

pool_maxedit

  • Value type is number
  • Default value is 50

Max number of concurrent connections. Defaults to 50

pool_max_per_routeedit

  • Value type is number
  • Default value is 25

Max number of concurrent connections to a single host. Defaults to 25

proxyedit

  • 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:

  1. Proxy host in form: http://proxy.org:1234
  2. Proxy host in form: {host => "proxy.org", port => 80, scheme => 'http', user => 'username@host', password => 'password'}
  3. Proxy host in form: {url => 'http://proxy.org:1234', user => 'username@host', password => 'password'}

request_timeoutedit

  • Value type is number
  • Default value is 60

Timeout (in seconds) for the entire request

retry_non_idempotentedit

  • 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.

socket_timeoutedit

  • Value type is number
  • Default value is 10

Timeout (in seconds) to wait for data on the socket. Default is 10s

ssl_certificate_validationedit

  • Value type is boolean
  • Default value is true

Set this to false to disable SSL/TLS certificate validation Note: setting this to false is generally considered insecure!

truststoreedit

  • 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!

truststore_passwordedit

  • 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!

truststore_typeedit

  • Value type is string
  • Default value is "JKS"

Specify the truststore type here. One of JKS or PKCS12. Default is JKS

urledit

  • This is a required setting.
  • Value type is string
  • There is no default value for this setting.

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, this gem does not yet support codecs. Please use the format option for now. URL to use

validate_after_inactivityedit

  • 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

workersedit

  • Value type is string
  • Default value is 1

TODO remove this in Logstash 6.0 when we no longer support the :legacy type This is hacky, but it can only be herne