==== Common Options

// Contributors: You must conditionally code all internal links and IDs in this
// file to make the common files work in both the LS Reference and the versioned
// plugin docs

The following configuration options are supported by all input plugins:

[cols="<,<,<",options="header",]
ifeval::["{versioned_docs}"!="true"]
|=======================================================================
|Setting |Input type|Required
| <<plugins-{type}s-{plugin}-add_field>> |{logstash-ref}/configuration-file-structure.html#hash[hash]|No
ifndef::no_codec[]
| <<plugins-{type}s-{plugin}-codec>> |{logstash-ref}/configuration-file-structure.html#codec[codec]|No
endif::no_codec[]
| <<plugins-{type}s-{plugin}-enable_metric>> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No
| <<plugins-{type}s-{plugin}-id>> |{logstash-ref}/configuration-file-structure.html#string[string]|No
| <<plugins-{type}s-{plugin}-tags>> |{logstash-ref}/configuration-file-structure.html#array[array]|No
| <<plugins-{type}s-{plugin}-type>> |{logstash-ref}/configuration-file-structure.html#string[string]|No
|=======================================================================
endif::[]
ifeval::["{versioned_docs}"=="true"]
|=======================================================================
|Setting |Input type|Required
| <<{version}-plugins-{type}s-{plugin}-add_field>> |{logstash-ref}/configuration-file-structure.html#hash[hash]|No
ifndef::no_codec[]
| <<{version}-plugins-{type}s-{plugin}-codec>> |{logstash-ref}/configuration-file-structure.html#codec[codec]|No
endif::no_codec[]
| <<{version}-plugins-{type}s-{plugin}-enable_metric>> |{logstash-ref}/configuration-file-structure.html#boolean[boolean]|No
| <<{version}-plugins-{type}s-{plugin}-id>> |{logstash-ref}/configuration-file-structure.html#string[string]|No
| <<{version}-plugins-{type}s-{plugin}-tags>> |{logstash-ref}/configuration-file-structure.html#array[array]|No
| <<{version}-plugins-{type}s-{plugin}-type>> |{logstash-ref}/configuration-file-structure.html#string[string]|No
|=======================================================================
endif::[]

==== Details

&nbsp;

ifeval::["{versioned_docs}"!="true"]
[id="plugins-{type}s-{plugin}-add_field"]
endif::[]
ifeval::["{versioned_docs}"=="true"]
[id="{version}-plugins-{type}s-{plugin}-add_field"]
endif::[]
===== `add_field`

  * Value type is {logstash-ref}/configuration-file-structure.html#hash[hash]
  * Default value is `{}`

Add a field to an event

ifndef::no_codec[]
ifeval::["{versioned_docs}"!="true"]
[id="plugins-{type}s-{plugin}-codec"]
endif::[]
ifeval::["{versioned_docs}"=="true"]
[id="{version}-plugins-{type}s-{plugin}-codec"]
endif::[]
===== `codec`

  * Value type is {logstash-ref}/configuration-file-structure.html#codec[codec]
ifdef::default_codec[]
  * Default value is +"{default_codec}"+
endif::[]
ifndef::default_codec[]
  * Default value is `"plain"`
endif::[]

The codec used for input data. Input codecs are a convenient method for decoding your data before it enters the input, without needing a separate filter in your Logstash pipeline.
endif::no_codec[]


ifeval::["{versioned_docs}"!="true"]
[id="plugins-{type}s-{plugin}-enable_metric"]
endif::[]
ifeval::["{versioned_docs}"=="true"]
[id="{version}-plugins-{type}s-{plugin}-enable_metric"]
endif::[]
===== `enable_metric`

  * Value type is {logstash-ref}/configuration-file-structure.html#boolean[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.

ifeval::["{versioned_docs}"!="true"]
[id="plugins-{type}s-{plugin}-id"]
endif::[]
ifeval::["{versioned_docs}"=="true"]
[id="{version}-plugins-{type}s-{plugin}-id"]
endif::[]
===== `id`

  * Value type is {logstash-ref}/configuration-file-structure.html#string[string]
  * There is no default value for this setting.

Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one.
It is strongly recommended to set this ID in your configuration. This is particularly useful
when you have two or more plugins of the same type, for example, if you have 2 {plugin} inputs.
Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.

["source","json",subs="attributes"]
---------------------------------------------------------------------------------------------------
input {
  {plugin} {
    id => "my_plugin_id"
  }
}
---------------------------------------------------------------------------------------------------

NOTE: Variable substitution in the `id` field only supports environment variables
      and does not support the use of values from the secret store.

ifeval::["{versioned_docs}"!="true"]
[id="plugins-{type}s-{plugin}-tags"]
endif::[]
ifeval::["{versioned_docs}"=="true"]
[id="{version}-plugins-{type}s-{plugin}-tags"]
endif::[]
===== `tags`

  * Value type is {logstash-ref}/configuration-file-structure.html#array[array]
  * There is no default value for this setting.

Add any number of arbitrary tags to your event.

This can help with processing later.

ifeval::["{versioned_docs}"!="true"]
[id="plugins-{type}s-{plugin}-type"]
endif::[]
ifeval::["{versioned_docs}"=="true"]
[id="{version}-plugins-{type}s-{plugin}-type"]
endif::[]
===== `type`

  * Value type is {logstash-ref}/configuration-file-structure.html#string[string]
  * There is no default value for this setting.

Add a `type` field to all events handled by this input.

Types are used mainly for filter activation.

The type is stored as part of the event itself, so you can
also use the type to search for it in Kibana.

If you try to set a type on an event that already has one (for
example when you send an event from a shipper to an indexer) then
a new input will not override the existing type. A type set at
the shipper stays with that event for its life even
when sent to another Logstash server.

ifeval::["{type}"=="input"]
ifeval::["{plugin}"=="beats"]

ifeval::["{versioned_docs}"!="true"]
NOTE: The Beats shipper automatically sets the `type` field on the event.
You cannot override this setting in the Logstash config. If you specify
a setting for the <<plugins-inputs-beats-type,`type`>> config option in
Logstash, it is ignored.
endif::[]
ifeval::["{versioned_docs}"=="true"]
NOTE: The Beats shipper automatically sets the `type` field on the event.
You cannot override this setting in the Logstash config. If you specify
a setting for the <<{version}-plugins-inputs-beats-type,`type`>> config option in
Logstash, it is ignored.
endif::[]

endif::[]
endif::[]

