mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
parent
b5062e7c18
commit
23744bfff6
3 changed files with 53 additions and 46 deletions
|
@ -24,18 +24,20 @@ If this filter is successful, add any arbitrary fields to this event.
|
||||||
Field names can be dynamic and include parts of the event using the `%{field}`.
|
Field names can be dynamic and include parts of the event using the `%{field}`.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
add_field => { "foo_%{somefield}" => "Hello world, from %{host}" }
|
add_field => { "foo_%\{somefield\}" => "Hello world, from %\{host\}" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
# You can also add multiple fields at once:
|
# You can also add multiple fields at once:
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
add_field => {
|
add_field => {
|
||||||
"foo_%{somefield}" => "Hello world, from %{host}"
|
"foo_%\{somefield\}" => "Hello world, from %\{host\}"
|
||||||
"new_field" => "new_static_value"
|
"new_field" => "new_static_value"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,17 +59,19 @@ Tags can be dynamic and include parts of the event using the `%{field}`
|
||||||
syntax.
|
syntax.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
add_tag => [ "foo_%{somefield}" ]
|
add_tag => [ "foo_%\{somefield\}" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
# You can also add multiple tags at once:
|
# You can also add multiple tags at once:
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
add_tag => [ "foo_%{somefield}", "taggedy_tag"]
|
add_tag => [ "foo_%\{somefield\}", "taggedy_tag"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,19 +94,18 @@ for a specific plugin.
|
||||||
* Value type is <<string,string>>
|
* Value type is <<string,string>>
|
||||||
* There is no default value for this setting.
|
* There is no default value for this setting.
|
||||||
|
|
||||||
Add a unique `ID` to the plugin instance, this `ID` is used for tracking
|
Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one.
|
||||||
information for a specific configuration of the plugin.
|
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} filters.
|
||||||
|
Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
|
||||||
|
|
||||||
```
|
|
||||||
output {
|
["source","json",subs="attributes"]
|
||||||
stdout {
|
filter {
|
||||||
|
{plugin} {
|
||||||
id => "ABC"
|
id => "ABC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
|
||||||
|
|
||||||
If you don't explicitely set this variable Logstash will generate a unique name.
|
|
||||||
|
|
||||||
|
|
||||||
[id="plugins-{type}s-{plugin}-periodic_flush"]
|
[id="plugins-{type}s-{plugin}-periodic_flush"]
|
||||||
===== `periodic_flush`
|
===== `periodic_flush`
|
||||||
|
@ -122,17 +125,19 @@ Optional.
|
||||||
If this filter is successful, remove arbitrary fields from this event.
|
If this filter is successful, remove arbitrary fields from this event.
|
||||||
Fields names can be dynamic and include parts of the event using the %{field}
|
Fields names can be dynamic and include parts of the event using the %{field}
|
||||||
Example:
|
Example:
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
remove_field => [ "foo_%{somefield}" ]
|
remove_field => [ "foo_%\{somefield\}" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
# You can also remove multiple fields at once:
|
# You can also remove multiple fields at once:
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
remove_field => [ "foo_%{somefield}", "my_extraneous_field" ]
|
remove_field => [ "foo_%\{somefield\}", "my_extraneous_field" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,17 +156,19 @@ Tags can be dynamic and include parts of the event using the `%{field}`
|
||||||
syntax.
|
syntax.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
remove_tag => [ "foo_%{somefield}" ]
|
remove_tag => [ "foo_%\{somefield\}" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[source,ruby]
|
|
||||||
|
["source","json",subs="attributes"]
|
||||||
# You can also remove multiple tags at once:
|
# You can also remove multiple tags at once:
|
||||||
filter {
|
filter {
|
||||||
PLUGIN_NAME {
|
{plugin} {
|
||||||
remove_tag => [ "foo_%{somefield}", "sad_unwanted_tag"]
|
remove_tag => [ "foo_%\{somefield\}", "sad_unwanted_tag"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,13 +52,13 @@ for a specific plugin.
|
||||||
|
|
||||||
Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one.
|
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
|
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 grok filters.
|
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.
|
Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
|
||||||
|
|
||||||
[source,ruby]
|
["source","json",subs="attributes"]
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
output {
|
input {
|
||||||
stdout {
|
{plugin} {
|
||||||
id => "my_plugin_id"
|
id => "my_plugin_id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,13 +37,13 @@ for a specific plugin.
|
||||||
|
|
||||||
Add a unique `ID` to the plugin configuration. If no ID is specified, Logstash will generate one.
|
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
|
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 grok filters.
|
when you have two or more plugins of the same type, for example, if you have 2 {plugin} outputs.
|
||||||
Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
|
Adding a named ID in this case will help in monitoring Logstash when using the monitoring APIs.
|
||||||
|
|
||||||
[source,ruby]
|
["source","json",subs="attributes"]
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
output {
|
output {
|
||||||
stdout {
|
{plugin} {
|
||||||
id => "my_plugin_id"
|
id => "my_plugin_id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue