Class: Logasm::Preprocessors::Whitelist
- Inherits:
-
Object
- Object
- Logasm::Preprocessors::Whitelist
- Defined in:
- lib/logasm/preprocessors/whitelist.rb
Defined Under Namespace
Classes: InvalidPointerFormatException
Constant Summary collapse
- DEFAULT_WHITELIST =
%w(/id /message /correlation_id /queue)
- MASK_SYMBOL =
'*'
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Whitelist
constructor
A new instance of Whitelist.
- #process(data) ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ Whitelist
Returns a new instance of Whitelist.
11 12 13 14 15 16 17 |
# File 'lib/logasm/preprocessors/whitelist.rb', line 11 def initialize(config = {}) pointers = (config[:pointers] || []) + DEFAULT_WHITELIST @fields_to_include = pointers.inject({}) do |mem, pointer| validate_pointer(pointer) mem.merge(decode(pointer) => true) end end |
Instance Method Details
#process(data) ⇒ Object
19 20 21 |
# File 'lib/logasm/preprocessors/whitelist.rb', line 19 def process(data) process_data('', data) end |