mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- remove more references to @field names and %{@message} and such...
This commit is contained in:
parent
7600b8188d
commit
c969a8a694
27 changed files with 57 additions and 80 deletions
|
@ -203,9 +203,9 @@ class LogStash::Event
|
|||
# any format values, delimited by %{foo} where 'foo' is a field or
|
||||
# metadata member.
|
||||
#
|
||||
# For example, if the event has @type == "foo" and @source == "bar"
|
||||
# For example, if the event has type == "foo" and source == "bar"
|
||||
# then this string:
|
||||
# "type is %{@type} and source is %{@source}"
|
||||
# "type is %{type} and source is %{source}"
|
||||
# will return
|
||||
# "type is foo and source is bar"
|
||||
#
|
||||
|
|
|
@ -60,13 +60,13 @@ class LogStash::Filters::Base < LogStash::Plugin
|
|||
#
|
||||
# filter {
|
||||
# %PLUGIN% {
|
||||
# add_field => [ "foo_%{somefield}", "Hello world, from %{@source}" ]
|
||||
# add_field => [ "foo_%{somefield}", "Hello world, from %{source}" ]
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# If the event has field "somefield" == "hello" this filter, on success,
|
||||
# would add field "foo_hello" if it is present, with the
|
||||
# value above and the %{@source} piece replaced with that value from the
|
||||
# value above and the %{source} piece replaced with that value from the
|
||||
# event.
|
||||
config :add_field, :validate => :hash, :default => {}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class LogStash::Filters::Range < LogStash::Filters::Base
|
|||
# "duration", 101, 200, "field:latency:normal",
|
||||
# "duration", 201, 1000, "field:latency:slow",
|
||||
# "duration", 1001, 1e1000, "field:latency:outlier"
|
||||
# "requests", 0, 10, "tag:to_few_%{@host_source}_requests" ]
|
||||
# "requests", 0, 10, "tag:to_few_%{source}_requests" ]
|
||||
# }
|
||||
# }
|
||||
#
|
||||
|
|
|
@ -47,7 +47,7 @@ class LogStash::Inputs::Base < LogStash::Plugin
|
|||
|
||||
# If format is "json", an event sprintf string to build what
|
||||
# the display @message should be given (defaults to the raw JSON).
|
||||
# sprintf format strings look like %{fieldname} or %{@metadata}.
|
||||
# sprintf format strings look like %{fieldname}
|
||||
#
|
||||
# If format is "json_event", ALL fields except for @type
|
||||
# are expected to be present. Not receiving all fields
|
||||
|
|
|
@ -28,9 +28,9 @@ class LogStash::Outputs::Circonus < LogStash::Outputs::Base
|
|||
# All values will be passed through `event.sprintf`
|
||||
#
|
||||
# Example:
|
||||
# ["title":"Logstash event", "description":"Logstash event for %{@source_host}"]
|
||||
# ["title":"Logstash event", "description":"Logstash event for %{host}"]
|
||||
# or
|
||||
# ["title":"Logstash event", "description":"Logstash event for %{@source_host}", "parent_id", "1"]
|
||||
# ["title":"Logstash event", "description":"Logstash event for %{host}", "parent_id", "1"]
|
||||
config :annotation, :validate => :hash, :required => true, :default => {}
|
||||
|
||||
public
|
||||
|
|
|
@ -16,10 +16,10 @@ class LogStash::Outputs::Datadog < LogStash::Outputs::Base
|
|||
config :api_key, :validate => :string, :required => true
|
||||
|
||||
# Title
|
||||
config :title, :validate => :string, :default => "Logstash event for %{@source_host}"
|
||||
config :title, :validate => :string, :default => "Logstash event for %{source}"
|
||||
|
||||
# Text
|
||||
config :text, :validate => :string, :default => "%{@message}"
|
||||
config :text, :validate => :string, :default => "%{message}"
|
||||
|
||||
# Date Happened
|
||||
config :date_happened, :validate => :string
|
||||
|
|
|
@ -28,7 +28,7 @@ class LogStash::Outputs::DatadogMetrics < LogStash::Outputs::Base
|
|||
config :metric_type, :validate => ["gauge", "counter"], :default => "%{metric_type}"
|
||||
|
||||
# The name of the host that produced the metric.
|
||||
config :host, :validate => :string, :default => "%{@source_host}"
|
||||
config :host, :validate => :string, :default => "%{source}"
|
||||
|
||||
# The name of the device that produced the metric.
|
||||
config :device, :validate => :string, :default => "%{metric_device}"
|
||||
|
|
|
@ -28,7 +28,7 @@ class LogStash::Outputs::ElasticSearchRiver < LogStash::Outputs::Base
|
|||
|
||||
# The index type to write events to. Generally you should try to write only
|
||||
# similar events to the same 'type'. String expansion '%{foo}' works here.
|
||||
config :index_type, :validate => :string, :default => "%{@type}"
|
||||
config :index_type, :validate => :string, :default => "%{type}"
|
||||
|
||||
# The name/address of an ElasticSearch host to use for river creation
|
||||
config :es_host, :validate => :string, :required => true
|
||||
|
|
|
@ -12,7 +12,7 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
|
|||
milestone 2
|
||||
|
||||
# The path to the file to write. Event fields can be used here,
|
||||
# like "/var/log/logstash/%{@source_host}/%{application}"
|
||||
# like "/var/log/logstash/%{host}/%{application}"
|
||||
# One may also utilize the path option for date-based log
|
||||
# rotation via the joda time format. This will use the event
|
||||
# timestamp.
|
||||
|
|
|
@ -13,7 +13,7 @@ class LogStash::Outputs::Ganglia < LogStash::Outputs::Base
|
|||
# The port to connect on your ganglia server.
|
||||
config :port, :validate => :number, :default => 8649
|
||||
|
||||
# The metric to use. This supports dynamic strings like `%{@source_host}`
|
||||
# The metric to use. This supports dynamic strings like `%{host}`
|
||||
config :metric, :validate => :string, :required => true
|
||||
|
||||
# The value to use. This supports dynamic strings like `%{bytes}`
|
||||
|
|
|
@ -38,7 +38,7 @@ class LogStash::Outputs::Gemfire < LogStash::Outputs::Base
|
|||
config :region_name, :validate => :string, :default => "Logstash"
|
||||
|
||||
# A sprintf format to use when building keys
|
||||
config :key_format, :validate => :string, :default => "%{@source}-%{@timestamp}"
|
||||
config :key_format, :validate => :string, :default => "%{source}-%{@timestamp}"
|
||||
|
||||
public
|
||||
def register
|
||||
|
|
|
@ -29,11 +29,11 @@ class LogStash::Outputs::Graphite < LogStash::Outputs::Base
|
|||
# Should metrics be resend on failure?
|
||||
config :resend_on_failure, :validate => :boolean, :default => false
|
||||
|
||||
# The metric(s) to use. This supports dynamic strings like %{@source_host}
|
||||
# The metric(s) to use. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value. Example:
|
||||
#
|
||||
# [ "%{@source_host}/uptime", "%{uptime_1m}" ]
|
||||
# [ "%{source}/uptime", "%{uptime_1m}" ]
|
||||
#
|
||||
# The value will be coerced to a floating point value. Values which cannot be
|
||||
# coerced will zero (0)
|
||||
|
|
|
@ -26,7 +26,7 @@ class LogStash::Outputs::HipChat < LogStash::Outputs::Base
|
|||
config :color, :validate => :string, :default => "yellow"
|
||||
|
||||
# Message format to send, event tokens are usable here.
|
||||
config :format, :validate => :string, :default => "%{@message}"
|
||||
config :format, :validate => :string, :default => "%{message}"
|
||||
|
||||
public
|
||||
def register
|
||||
|
|
|
@ -23,7 +23,7 @@ class LogStash::Outputs::Http < LogStash::Outputs::Base
|
|||
config :http_method, :validate => ["put", "post"], :required => :true
|
||||
|
||||
# Custom headers to use
|
||||
# format is `headers => ["X-My-Header", "%{@source_host}"]
|
||||
# format is `headers => ["X-My-Header", "%{source}"]
|
||||
config :headers, :validate => :hash
|
||||
|
||||
# Content type
|
||||
|
@ -39,7 +39,7 @@ class LogStash::Outputs::Http < LogStash::Outputs::Base
|
|||
#
|
||||
# For example:
|
||||
#
|
||||
# mapping => ["foo", "%{@source_host}", "bar", "%{@type}"]
|
||||
# mapping => ["foo", "%{source}", "bar", "%{type}"]
|
||||
config :mapping, :validate => :hash
|
||||
|
||||
# Set the format of the http body.
|
||||
|
|
|
@ -31,7 +31,7 @@ class LogStash::Outputs::Juggernaut < LogStash::Outputs::Base
|
|||
config :password, :validate => :password
|
||||
|
||||
# List of channels to which to publish. Dynamic names are
|
||||
# valid here, for example "logstash-%{@type}".
|
||||
# valid here, for example "logstash-%{type}".
|
||||
config :channels, :validate => :array, :required => true
|
||||
|
||||
# How should the message be formatted before pushing to the websocket.
|
||||
|
|
|
@ -21,9 +21,9 @@ class LogStash::Outputs::Librato < LogStash::Outputs::Base
|
|||
# Send data to Librato as a gauge
|
||||
#
|
||||
# Example:
|
||||
# ["value", "%{bytes_recieved}", "source", "%{@source_host}", "name", "apache_bytes"]
|
||||
# ["value", "%{bytes_recieved}", "source", "%{source}", "name", "apache_bytes"]
|
||||
# Additionally, you can override the `measure_time` for the event. Must be a unix timestamp:
|
||||
# ["value", "%{bytes_recieved}", "source", "%{@source_host}", "name", "apache_bytes","measure_time", "%{my_unixtime_field}]
|
||||
# ["value", "%{bytes_recieved}", "source", "%{source}", "name", "apache_bytes","measure_time", "%{my_unixtime_field}]
|
||||
# Default is to use the event's timestamp
|
||||
config :gauge, :validate => :hash, :default => {}
|
||||
|
||||
|
@ -31,9 +31,9 @@ class LogStash::Outputs::Librato < LogStash::Outputs::Base
|
|||
# Send data to Librato as a counter
|
||||
#
|
||||
# Example:
|
||||
# ["value", "1", "source", "%{@source_host}", "name", "messages_received"]
|
||||
# ["value", "1", "source", "%{source}", "name", "messages_received"]
|
||||
# Additionally, you can override the `measure_time` for the event. Must be a unix timestamp:
|
||||
# ["value", "1", "source", "%{@source_host}", "name", "messages_received", "measure_time", "%{my_unixtime_field}"]
|
||||
# ["value", "1", "source", "%{source}", "name", "messages_received", "measure_time", "%{my_unixtime_field}"]
|
||||
# Default is to use the event's timestamp
|
||||
config :counter, :validate => :hash, :default => {}
|
||||
|
||||
|
@ -45,20 +45,11 @@ class LogStash::Outputs::Librato < LogStash::Outputs::Base
|
|||
# All values will be passed through `event.sprintf`
|
||||
#
|
||||
# Example:
|
||||
# ["title":"Logstash event on %{@source_host}", "name":"logstash_stream"]
|
||||
# ["title":"Logstash event on %{source}", "name":"logstash_stream"]
|
||||
# or
|
||||
# ["title":"Logstash event", "description":"%{@message}", "name":"logstash_stream"]
|
||||
# ["title":"Logstash event", "description":"%{message}", "name":"logstash_stream"]
|
||||
config :annotation, :validate => :hash, :default => {}
|
||||
|
||||
# Named metrics (NYI)
|
||||
# These allow multiple metrics/annotations in the same output
|
||||
# Examples:
|
||||
# (Gauge)
|
||||
# `apache_bytes => ["type", "gauge", "source", "%{@source_host}", "value", "%{bytes_received}"]`
|
||||
# (Counter)
|
||||
# `messages_received => ["type", "counter", "source", "%{@source_host}", "value", "1"]`
|
||||
# config /[A-Za-z0-9.:_-]+/, :validate => :hash
|
||||
|
||||
# Batch size
|
||||
# Number of events to batch up before sending to Librato.
|
||||
#
|
||||
|
|
|
@ -13,7 +13,7 @@ require "json"
|
|||
# port => "1420"
|
||||
# type => "apache-access"
|
||||
# fields => [ "response" ]
|
||||
# meter => [ "%{@source_host}.apache.response.%{response}", "1" ]
|
||||
# meter => [ "%{source}.apache.response.%{response}", "1" ]
|
||||
# }
|
||||
class LogStash::Outputs::MetricCatcher < LogStash::Outputs::Base
|
||||
config_name "metriccatcher"
|
||||
|
@ -24,7 +24,7 @@ class LogStash::Outputs::MetricCatcher < LogStash::Outputs::Base
|
|||
# The port to connect on your MetricCatcher
|
||||
config :port, :validate => :number, :default => 1420
|
||||
|
||||
# The metrics to send. This supports dynamic strings like %{@source_host}
|
||||
# The metrics to send. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value.
|
||||
#
|
||||
|
@ -32,17 +32,17 @@ class LogStash::Outputs::MetricCatcher < LogStash::Outputs::Base
|
|||
# coerced will zero (0)
|
||||
config :gauge, :validate => :hash
|
||||
|
||||
# The metrics to send. This supports dynamic strings like %{@source_host}
|
||||
# The metrics to send. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value. Example:
|
||||
#
|
||||
# counter => [ "%{@source_host}.apache.hits.%{response}, "1" ]
|
||||
# counter => [ "%{source}.apache.hits.%{response}, "1" ]
|
||||
#
|
||||
# The value will be coerced to a floating point value. Values which cannot be
|
||||
# coerced will zero (0)
|
||||
config :counter, :validate => :hash
|
||||
|
||||
# The metrics to send. This supports dynamic strings like %{@source_host}
|
||||
# The metrics to send. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value.
|
||||
#
|
||||
|
@ -50,7 +50,7 @@ class LogStash::Outputs::MetricCatcher < LogStash::Outputs::Base
|
|||
# coerced will zero (0)
|
||||
config :meter, :validate => :hash
|
||||
|
||||
# The metrics to send. This supports dynamic strings like %{@source_host}
|
||||
# The metrics to send. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value.
|
||||
#
|
||||
|
@ -58,7 +58,7 @@ class LogStash::Outputs::MetricCatcher < LogStash::Outputs::Base
|
|||
# coerced will zero (0)
|
||||
config :biased, :validate => :hash
|
||||
|
||||
# The metrics to send. This supports dynamic strings like %{@source_host}
|
||||
# The metrics to send. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value.
|
||||
#
|
||||
|
@ -66,11 +66,11 @@ class LogStash::Outputs::MetricCatcher < LogStash::Outputs::Base
|
|||
# coerced will zero (0)
|
||||
config :uniform, :validate => :hash
|
||||
|
||||
# The metrics to send. This supports dynamic strings like %{@source_host}
|
||||
# The metrics to send. This supports dynamic strings like %{source}
|
||||
# for metric names and also for values. This is a hash field with key
|
||||
# of the metric name, value of the metric value. Example:
|
||||
#
|
||||
# timer => [ "%{@source_host}.apache.response_time, "%{response_time}" ]
|
||||
# timer => [ "%{source}.apache.response_time, "%{response_time}" ]
|
||||
#
|
||||
# The value will be coerced to a floating point value. Values which cannot be
|
||||
# coerced will zero (0)
|
||||
|
|
|
@ -21,27 +21,13 @@ require "logstash/outputs/base"
|
|||
# CRITICAL and can be overriden by setting the "nagios_level" field to one
|
||||
# of "OK", "WARNING", "CRITICAL", or "UNKNOWN"
|
||||
#
|
||||
# The easiest way to use this output is with the grep filter.
|
||||
# Presumably, you only want certain events matching a given pattern
|
||||
# to send events to nagios. So use grep to match and also to add the required
|
||||
# fields.
|
||||
#
|
||||
# filter {
|
||||
# grep {
|
||||
# type => "linux-syslog"
|
||||
# match => [ "@message", "(error|ERROR|CRITICAL)" ]
|
||||
# add_tag => [ "nagios-update" ]
|
||||
# add_field => [
|
||||
# "nagios_host", "%{@source_host}",
|
||||
# "nagios_service", "the name of your nagios service check"
|
||||
# ]
|
||||
# }
|
||||
# }
|
||||
# match => [ "message", "(error|ERROR|CRITICAL)" ]
|
||||
#
|
||||
# output{
|
||||
# if [message] =~ /(error|ERROR|CRITICAL)/ {
|
||||
# nagios {
|
||||
# # only process events with this tag
|
||||
# tags => "nagios-update"
|
||||
# # your config here
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
class LogStash::Outputs::Nagios < LogStash::Outputs::Base
|
||||
|
|
|
@ -44,7 +44,7 @@ class LogStash::Outputs::NagiosNsca < LogStash::Outputs::Base
|
|||
# The nagios 'host' you want to submit a passive check result to. This
|
||||
# parameter accepts interpolation, e.g. you can use @source_host or other
|
||||
# logstash internal variables.
|
||||
config :nagios_host, :validate => :string, :default => "%{@source_host}"
|
||||
config :nagios_host, :validate => :string, :default => "%{host}"
|
||||
|
||||
# The nagios 'service' you want to submit a passive check result to. This
|
||||
# parameter accepts interpolation, e.g. you can use @source_host or other
|
||||
|
@ -54,7 +54,7 @@ class LogStash::Outputs::NagiosNsca < LogStash::Outputs::Base
|
|||
# The format to use when writing events to nagios. This value
|
||||
# supports any string and can include %{name} and other dynamic
|
||||
# strings.
|
||||
config :message_format, :validate => :string, :default => "%{@timestamp} %{@source}: %{@message}"
|
||||
config :message_format, :validate => :string, :default => "%{@timestamp} %{source}: %{message}"
|
||||
|
||||
public
|
||||
def register
|
||||
|
|
|
@ -18,17 +18,17 @@ class LogStash::Outputs::Opentsdb < LogStash::Outputs::Base
|
|||
# The port to connect on your graphite server.
|
||||
config :port, :validate => :number, :default => 4242
|
||||
|
||||
# The metric(s) to use. This supports dynamic strings like %{@source_host}
|
||||
# The metric(s) to use. This supports dynamic strings like %{source_host}
|
||||
# for metric names and also for values. This is an array field with key
|
||||
# of the metric name, value of the metric value, and multiple tag,values . Example:
|
||||
#
|
||||
# [
|
||||
# "%{@source_host}/uptime",
|
||||
# "%{host}/uptime",
|
||||
# %{uptime_1m} " ,
|
||||
# "hostname" ,
|
||||
# "%{@source_host}
|
||||
# "%{host}
|
||||
# "anotherhostname" ,
|
||||
# "%{@source_host}
|
||||
# "%{host}
|
||||
# ]
|
||||
#
|
||||
# The value will be coerced to a floating point value. Values which cannot be
|
||||
|
|
|
@ -13,18 +13,18 @@ class LogStash::Outputs::PagerDuty < LogStash::Outputs::Base
|
|||
|
||||
# The service key to use
|
||||
# You'll need to set this up in PD beforehand
|
||||
config :incident_key, :validate => :string, :default => "logstash/%{@source_host}/%{@type}"
|
||||
config :incident_key, :validate => :string, :default => "logstash/%{host}/%{type}"
|
||||
|
||||
# Event type
|
||||
config :event_type, :validate => ["trigger", "acknowledge", "resolve"], :default => "trigger"
|
||||
|
||||
# Custom description
|
||||
config :description, :validate => :string, :default => "Logstash event for %{@source_host}"
|
||||
config :description, :validate => :string, :default => "Logstash event for %{host}"
|
||||
|
||||
# Event details
|
||||
# These might be keys from the logstash event you wish to include
|
||||
# tags are automatically included if detected so no need to add them here
|
||||
config :details, :validate => :hash, :default => {"timestamp" => "%{@timestamp}", "message" => "%{@message}"}
|
||||
config :details, :validate => :hash, :default => {"timestamp" => "%{@timestamp}", "message" => "%{message}"}
|
||||
|
||||
# PagerDuty API url
|
||||
# You shouldn't need to change this
|
||||
|
|
|
@ -43,12 +43,12 @@ class LogStash::Outputs::Redis < LogStash::Outputs::Base
|
|||
config :password, :validate => :password
|
||||
|
||||
# The name of the redis queue (we'll use RPUSH on this). Dynamic names are
|
||||
# valid here, for example "logstash-%{@type}"
|
||||
# valid here, for example "logstash-%{type}"
|
||||
# TODO: delete
|
||||
config :queue, :validate => :string, :deprecated => true
|
||||
|
||||
# The name of a redis list or channel. Dynamic names are
|
||||
# valid here, for example "logstash-%{@type}".
|
||||
# valid here, for example "logstash-%{type}".
|
||||
# TODO set required true
|
||||
config :key, :validate => :string, :required => false
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class LogStash::Outputs::Riemann < LogStash::Outputs::Base
|
|||
# The name of the sender.
|
||||
# This sets the `host` value
|
||||
# in the Riemann event
|
||||
config :sender, :validate => :string, :default => "%{@source_host}"
|
||||
config :sender, :validate => :string, :default => "%{host}"
|
||||
|
||||
# A Hash to set Riemann event fields
|
||||
# (<http://aphyr.github.com/riemann/concepts.html>).
|
||||
|
|
|
@ -16,7 +16,7 @@ require "logstash/plugin_mixins/aws_config"
|
|||
# * sns - If no ARN is found in the configuration file, this will be used as
|
||||
# the ARN to publish.
|
||||
# * sns_subject - The subject line that should be used.
|
||||
# Optional. The "%{@source}" will be used if not present and truncated at
|
||||
# Optional. The "%{source}" will be used if not present and truncated at
|
||||
# MAX_SUBJECT_SIZE_IN_CHARACTERS.
|
||||
# * sns_message - The message that should be
|
||||
# sent. Optional. The event serialzed as JSON will be used if not present and
|
||||
|
|
|
@ -64,7 +64,7 @@ class LogStash::Outputs::Syslog < LogStash::Outputs::Base
|
|||
config :severity, :validate => SEVERITY_LABELS, :required => true
|
||||
|
||||
# source host for syslog message
|
||||
config :sourcehost, :validate => :string, :default => "%{@source_host}"
|
||||
config :sourcehost, :validate => :string, :default => "%{source}"
|
||||
|
||||
# timestamp for syslog message
|
||||
config :timestamp, :validate => :string, :default => "%{@timestamp}"
|
||||
|
|
|
@ -26,7 +26,7 @@ class LogStash::Outputs::Xmpp < LogStash::Outputs::Base
|
|||
# the host on the user/identity is used. (foo.com for user@foo.com)
|
||||
config :host, :validate => :string
|
||||
|
||||
# The message to send. This supports dynamic strings like %{@source_host}
|
||||
# The message to send. This supports dynamic strings like %{source}
|
||||
config :message, :validate => :string, :required => true
|
||||
|
||||
public
|
||||
|
|
|
@ -24,7 +24,7 @@ require "logstash/outputs/base"
|
|||
# match => [ "@message", "(error|ERROR|CRITICAL)" ]
|
||||
# add_tag => [ "zabbix-sender" ]
|
||||
# add_field => [
|
||||
# "zabbix_host", "%{@source_host}",
|
||||
# "zabbix_host", "%{source_host}",
|
||||
# "zabbix_item", "item.key"
|
||||
# ]
|
||||
# }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue