Class: Fluent::Plugin::RedisEnrichmentFilter::CleanroomExpander
- Inherits:
-
Object
- Object
- Fluent::Plugin::RedisEnrichmentFilter::CleanroomExpander
- Defined in:
- lib/fluent/plugin/filter_redis_enrichment.rb
Overview
safer object to eval code from record_transformer filter plugin
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
- #expand(__str_to_eval__, tag: nil, time: nil, record: nil, redis: nil, **_extra) ⇒ Object
-
#initialize(log) ⇒ CleanroomExpander
constructor
A new instance of CleanroomExpander.
Constructor Details
#initialize(log) ⇒ CleanroomExpander
Returns a new instance of CleanroomExpander.
292 293 294 |
# File 'lib/fluent/plugin/filter_redis_enrichment.rb', line 292 def initialize(log) @log = log end |
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
290 291 292 |
# File 'lib/fluent/plugin/filter_redis_enrichment.rb', line 290 def log @log end |
Instance Method Details
#expand(__str_to_eval__, tag: nil, time: nil, record: nil, redis: nil, **_extra) ⇒ Object
296 297 298 299 300 301 302 |
# File 'lib/fluent/plugin/filter_redis_enrichment.rb', line 296 def (__str_to_eval__, tag: nil, time: nil, record: nil, redis: nil, **_extra) instance_eval(__str_to_eval__) rescue NoMethodError => e nil rescue StandardError => e log.warn("while expanding #{__str_to_eval__}: #{e}") end |