Skip to content

Instantly share code, notes, and snippets.

@bobtfish
Created February 27, 2013 11:33
Show Gist options
  • Save bobtfish/5047274 to your computer and use it in GitHub Desktop.
Save bobtfish/5047274 to your computer and use it in GitHub Desktop.
require "logstash/filters/base"
require "logstash/namespace"
class LogStash::Filters::MaxID < LogStash::Filters::Base
@@max_id = 1
config_name "max_id"
plugin_status "experimental"
public
def filter(event)
return unless filter?(event)
@@max_id = @@max_id + 1
event["max_id"] = @@max_id
filter_matched(event)
end # def filter
end # class LogStash::Filters::MaxID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment