Skip to content

Commit

Permalink
unsused charset option
Browse files Browse the repository at this point in the history
  • Loading branch information
colinsurprenant committed Apr 7, 2014
1 parent 2c8fdbc commit 8c5b445
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions lib/logstash/codecs/graphite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,13 @@ class LogStash::Codecs::Graphite < LogStash::Codecs::Base

milestone 2

# The character encoding used in this codec. Examples include "UTF-8" and
# "CP1252"
#
# JSON requires valid UTF-8 strings, but in some cases, software that
# emits JSON does so in another encoding (nxlog, for example). In
# weird cases like this, you can set the charset setting to the
# actual encoding of the text and logstash will convert it for you.
#
# For nxlog users, you'll want to set this to "CP1252"
config :charset, :validate => ::Encoding.name_list, :default => "UTF-8"

EXCLUDE_ALWAYS = [ "@timestamp", "@version" ]

DEFAULT_METRICS_FORMAT = "*"
METRIC_PLACEHOLDER = "*"

# The metric(s) to use. This supports dynamic strings like %{host}
# for metric names and also for values. This is a hash field with key
# for metric names and also for values. This is a hash field with key
# of the metric name, value of the metric value. Example:
#
# [ "%{host}/uptime", "%{uptime_1m}" ]
Expand All @@ -51,14 +40,14 @@ class LogStash::Codecs::Graphite < LogStash::Codecs::Base
#
# NOTE: If no metrics_format is defined the name of the metric will be used as fallback.
config :metrics_format, :validate => :string, :default => DEFAULT_METRICS_FORMAT


public
def initialize(params={})
super(params)
@lines = LogStash::Codecs::Line.new
end

public
def decode(data)
@lines.decode(data) do |event|
Expand All @@ -75,7 +64,7 @@ def construct_metric_name(metric)

return metric
end

public
def encode(event)
# Graphite message format: metric value timestamp\n
Expand Down Expand Up @@ -111,4 +100,4 @@ def encode(event)
end # if messages.empty?
end # def encode

end # class LogStash::Codecs::JSON
end # class LogStash::Codecs::Graphite

0 comments on commit 8c5b445

Please sign in to comment.