A basic filter that knows how to check message content.
This is a boolean processor, so it merely returns true or false based on the filter result. Use this in conjunction with an If processor to actually perform other actions based on the result.
Create a new filter. you must provide content, which can be a string or a regex.
Recognized options include:
:accept_non_messages
If set to true, accepts entries that are not messages. Otherwise, if set to false or not specified, rejects such entries.
# File lib/sawmill/entry_processor/filter_by_message.rb, line 60 def initialize(content_, opts_={}) @content = content_ @accept_non_messages = opts_[:accept_non_messages] ? true : false end
# File lib/sawmill/entry_processor/filter_by_message.rb, line 78 def attribute(entry_) @accept_non_messages end
# File lib/sawmill/entry_processor/filter_by_message.rb, line 66 def begin_record(entry_) @accept_non_messages end
# File lib/sawmill/entry_processor/filter_by_message.rb, line 70 def end_record(entry_) @accept_non_messages end
# File lib/sawmill/entry_processor/filter_by_message.rb, line 86 def finish nil end
# File lib/sawmill/entry_processor/filter_by_message.rb, line 74 def message(entry_) @content === entry_.message end
# File lib/sawmill/entry_processor/filter_by_message.rb, line 82 def unknown_data(entry_) @accept_non_messages end