Skip to content

Commit

Permalink
Fixed some code blocks issues in kv and date filters docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jamtur01 committed Jan 2, 2013
1 parent 0004850 commit 7258b7a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
41 changes: 20 additions & 21 deletions lib/logstash/filters/date.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# date or timestamp as the timestamp for the event.
#
# For example, syslog events usually have timestamps like this:
# "Apr 17 09:32:01"
#
# "Apr 17 09:32:01"
#
# You would use the date format "MMM dd HH:mm:ss" to parse this.
#
Expand All @@ -32,7 +33,8 @@ class LogStash::Filters::Date < LogStash::Filters::Base
config :locale, :validate => :string

# Config for date is:
# fieldname => dateformat
#
# fieldname => dateformat
#
# The same field can be specified multiple times (or multiple dateformats for
# the same field) do try different time formats; first success wins.
Expand Down Expand Up @@ -63,10 +65,10 @@ class LogStash::Filters::Date < LogStash::Filters::Base
#
# An array with field name first, and format patterns following, [ field,
# formats... ]
#
#
# If your time field has multiple possible formats, you can do this:
#
# match => [ "logdate", "MMM dd YYY HH:mm:ss",
# match => [ "logdate", "MMM dd YYY HH:mm:ss",
# "MMM d YYY HH:mm:ss", "ISO8601" ]
#
# The above will match a syslog (rfc3164) or iso8601 timestamp.
Expand All @@ -83,11 +85,12 @@ class LogStash::Filters::Date < LogStash::Filters::Base
# For example, if you have a field 'logdate' and with a value that looks like
# 'Aug 13 2010 00:03:44', you would use this configuration:
#
# filter {
# date {
# match => [ "logdate", "MMM dd YYYY HH:mm:ss" ]
# }
# }
# filter {
# date {
# match => [ "logdate", "MMM dd YYYY HH:mm:ss" ]
# }
# }
#
config :match, :validate => :array, :default => []

# LOGSTASH-34
Expand All @@ -99,15 +102,14 @@ class LogStash::Filters::Date < LogStash::Filters::Base
#
# The config looks like this:
#
# filter {
# date {
# type => "typename"
# fielname => fieldformat
#
# # Example:
# timestamp => "mmm DD HH:mm:ss"
# }
# }
# filter {
# date {
# type => "typename"
# filename => fieldformat
# # Example:
# timestamp => "mmm DD HH:mm:ss"
# }
# }
#
# The format is whatever is supported by Joda; generally:
# http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
Expand All @@ -120,9 +122,6 @@ def initialize(config = {})
@parsers = Hash.new { |h,k| h[k] = [] }
end # def initialize




private
def parseLocale(localeString)
return nil if localeString == nil
Expand Down
9 changes: 5 additions & 4 deletions lib/logstash/filters/kv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#
# For example, if you have a log message which contains 'ip=1.2.3.4
# error=REFUSED', you can parse those automatically by doing:
#
# filter {
# kv { }
# }
#
#
# filter {
# kv { }
# }
#
# And you will get field 'ip' == "1.2.3.4" etc.
class LogStash::Filters::KV < LogStash::Filters::Base
Expand Down

0 comments on commit 7258b7a

Please sign in to comment.