1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00

Fix typos and omissions in the documentation of the Replace filter

This commit is contained in:
Holger Just 2017-09-23 00:38:22 +02:00
parent c383e2b3dc
commit d66408d333

View File

@ -8,10 +8,13 @@
module Rackstash module Rackstash
module Filters module Filters
# Replace fields in the given event with new values. A new value can be # Replace fields in the given event with new values. A new value can be
# specified as either a fixed value or as a Proc (or any other object # specified as either a fixed value or as a `Proc` (or any other object
# responding to `call`). In the latter case, the callable object will be # responding to `call`). In the latter case, the callable object will be
# called with the event as its argument. It is then expectd to return the # called with the event as its argument. It is then expected to return the
# new value which is set on the key # new value which is set on the key.
#
# If a specified field does not exist in the event hash, it will be created
# with the given (or calculated) value anyway.
# #
# @example # @example
# Rackstash::Flow.new(STDOUT) do # Rackstash::Flow.new(STDOUT) do
@ -20,8 +23,9 @@ module Rackstash
# } # }
# end # end
# #
# You should make sure to only set a new object of the basic types here, # You should make sure to only set a new object of one of the basic types
# namely `String`, `Integer`, `Float`, `nil`, `true`, or `false`. # here, namely `String`, `Integer`, `Float`, `Hash`, `Array`, `nil`, `true`,
# or `false`.
class Replace class Replace
# @param spec [Hash<#to_s => #call,Object>] a `Hash` specifying new field # @param spec [Hash<#to_s => #call,Object>] a `Hash` specifying new field
# values for the named keys. Values can be given in the form of a fixed # values for the named keys. Values can be given in the form of a fixed
@ -34,9 +38,7 @@ module Rackstash
end end
end end
# Replace field values in the event to a new value. If a specified field # Replace or set fields in the event to a new value.
# does not exist in the event hah, it will be created with the goven (or
# calculated) value anyway.
# #
# @param event [Hash] an event hash # @param event [Hash] an event hash
# return [Hash] the given `event` with the fields renamed # return [Hash] the given `event` with the fields renamed