Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: gja/logstash
...
head fork: gja/logstash
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 4 files changed
  • 2 commit comments
  • 2 contributors
View
1  CHANGELOG
@@ -5,6 +5,7 @@
* New filter plugins: zeromq
* Fixes for gelf output
* Fixes for elasticsearch_river output
+ * Fixes for ganglia output
## IMPORTANT CHANGES FOR UPGRADES FROM 1.1.0
- zeromq input and output rewritten
View
9 lib/logstash/event.rb
@@ -69,11 +69,12 @@ def timestamp=(val); @data["@timestamp"] = val; end # def timestamp=
public
def unix_timestamp
if RUBY_ENGINE != "jruby"
- # TODO(sissel): LOGSTASH-217
- raise Exception.new("LogStash::Event#unix_timestamp is not supported yet in this version of ruby")
+ # This is really slow. See LOGSTASH-217
+ return Time.parse(timestamp).to_f
+ else
+ time = @@date_parser.parseDateTime(timestamp)
+ return time.getMillis.to_f / 1000
end
- time = @@date_parser.parseDateTime(timestamp)
- return time.getMillis.to_f / 1000
end
public
View
4 lib/logstash/outputs/ganglia.rb
@@ -44,7 +44,7 @@ def receive(event)
return unless output?(event)
# gmetric only takes integer values, so convert it to int.
- case @type
+ case @metric_type
when "string"
localvalue = event.sprintf(@value)
when "float"
@@ -57,7 +57,7 @@ def receive(event)
Ganglia::GMetric.send(@host, @port, {
:name => event.sprintf(@metric),
:units => @units,
- :type => @type,
+ :type => @metric_type,
:value => localvalue,
:tmax => @tmax,
:dmax => @dmax
View
10 lib/logstash/outputs/gelf.rb
@@ -64,11 +64,13 @@ def register
@gelf.level = 0
@level_map = {
- "debug" => 7, "d" => 7,
- "info" => 6, "i" => 6,
- "warn" => 5, "w" => 5,
+ "debug" => 0, "d" => 0,
+ "info" => 1, "i" => 1,
+ "notice" => 2, "n" => 2,
+ "warn" => 3, "w" => 3,
"error" => 4, "e" => 4,
- "fatal" => 3, "f" => 3,
+ "fatal" => 5, "f" => 5,
+ "alert" => 6, "a" => 6,
"unknown" => 1, "u" => 1,
}
end # def register

Showing you all comments on commits in this comparison.

@lusis

So there's a config option right now to handle custom mappings. I'm no longer a GELF output user. What impact does this change have on folks already expecting the old mappings? Were they 'broken'? I know we've had issue with this in the past.

My thought right now is to stop using the gelf gem all together and write our own. The main reason here is that it's designed for, as you rightly point out, ruby mappings - things like logging from a rails app or whatever. The problem is that we're not doing any ruby logging. We're doing logging from non-ruby things and munging it out via gelf.

@gja do you feel, as a gelf output user, that this pull addresses that use case properly?

@gja
Owner

I suspect that people using this are currently broken. When I used this, at least, everything was showwing up in Graylog as DEBUG, and I had no reason why.

In my use case, I'm mapping parsing rails logs, and getting strings like INFO, which should be mapped to GELF's info. I would rather continue to use the existing gem, as we don't want to duplicate all that code, and maintain it ourselves.

Padrino Gelf Logger has the logging levels mapped here: https://github.com/pzol/padrino_gelflogger/blob/master/lib/padrino_gelflogger/gelf_logger.rb#L5

Something went wrong with that request. Please try again.