http

Milestone: 1

Synopsis

This is what it might look like in your config file:
output {
  http {
    codec => ... # codec (optional), default: "plain"
    content_type => ... # string (optional)
    format => ... # string, one of ["json", "form", "message"] (optional), default: "json"
    headers => ... # hash (optional)
    http_method => ... # string, one of ["put", "post"] (required)
    mapping => ... # hash (optional)
    message => ... # string (optional)
    url => ... # string (required)
    verify_ssl => ... # boolean (optional), default: true
    workers => ... # number (optional), default: 1
  }
}

Details

codec

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

content_type

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

exclude_tags DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is array
  • Default value is []

Only handle events without any of these tags. Note this check is additional to type and tags.

format

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

headers

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

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

http_method (required setting)

  • Value can be any of: "put", "post"
  • There is no default value for this setting.

What verb to use only put and post are supported for now

mapping

  • 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}”]

message

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

tags DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is array
  • Default value is []

Only handle events with all of these tags. Note that if you specify a type, the event must also match that type. Optional.

type DEPRECATED

  • DEPRECATED WARNING: This config item is deprecated. It may be removed in a further version.
  • Value type is string
  • Default value is ""

The type to act on. If a type is given, then this output will only act on messages with the same type. See any input plugin’s “type” attribute for more. Optional.

url (required setting)

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

This output lets you PUT or POST events to a generic HTTP(S) endpoint

Additionally, you are given the option to customize the headers sent as well as basic customization of the event json itself. URL to use

verify_ssl

  • Value type is boolean
  • Default value is true

validate SSL?

workers

  • Value type is number
  • Default value is 1

The number of workers to use for this output. Note that this setting may not be useful for all outputs.


This is documentation from lib/logstash/outputs/http.rb