mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- use milestones
- use event[...] now
This commit is contained in:
parent
27dfd37a53
commit
6a1b17f341
2 changed files with 11 additions and 10 deletions
|
@ -36,8 +36,9 @@ Now add the code:
|
|||
# foo { ... }
|
||||
# }
|
||||
config_name "foo"
|
||||
# need to set a plugin_status
|
||||
plugin_status "experimental"
|
||||
|
||||
# New plugins should start life at milestone 1.
|
||||
milestone 1
|
||||
|
||||
# Replace the message with this value.
|
||||
config :message, :validate => :string
|
||||
|
@ -54,8 +55,7 @@ Now add the code:
|
|||
if @message
|
||||
# Replace the event message with our message as configured in the
|
||||
# config file.
|
||||
# If no message is specified, do nothing.
|
||||
event.message = @message
|
||||
event["message"] = @message
|
||||
end
|
||||
# filter_matched should go in the last line of our successful code
|
||||
filter_matched(event)
|
||||
|
@ -71,9 +71,10 @@ The config file looks like this:
|
|||
stdin { type => "foo" }
|
||||
}
|
||||
filter {
|
||||
foo {
|
||||
type => "foo"
|
||||
message => "Hello world!"
|
||||
if [type] == "foo" {
|
||||
foo {
|
||||
message => "Hello world!"
|
||||
}
|
||||
}
|
||||
}
|
||||
output {
|
||||
|
|
|
@ -17,7 +17,7 @@ If you're looking to extend logstash today, please look at the existing plugins.
|
|||
## Common concepts
|
||||
|
||||
* The `config_name` sets the name used in the config file.
|
||||
* The `plugin_status` sets the status of the plugin for example `beta`.
|
||||
* The `milestone` sets the milestone number of the plugin. See <../plugin-milestones> for more info.
|
||||
* The `config` lines define config options.
|
||||
* The `register` method is called per plugin instantiation. Do any of your initialization here.
|
||||
|
||||
|
@ -32,9 +32,9 @@ All plugins should require the Logstash module.
|
|||
Every plugin must have a name set with the `config_name` method. If this
|
||||
is not specified plugins will fail to load with an error.
|
||||
|
||||
### Plugin status
|
||||
### Milestones
|
||||
|
||||
Every plugin needs a status set using `plugin_status`. Valid values are
|
||||
Every plugin needs a status set using `milestone`. Valid values are
|
||||
`stable`, `beta`, `experimental`, and `unsupported`. Plugins with either
|
||||
the `experimental` and `unsupported` status will generate warnings when
|
||||
used.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue