Skip to content

Cannot process Float Or Integer number  #17

@xuto2

Description

@xuto2

I'm getting the below error with fluentd 1.16.3 when using this plugin:

2024-02-15 07:47:12 +0000 [warn]: #0 dump an error event: error_class=NoMethodError error="undefined method =~' for 1707983231.364:Float" location="/usr/lib/ruby/gems/3.2.0/gems/fluent-plugin-string-scrub-1.0.1/lib/fluent/plugin/filter_string_scrub.rb:51:in with_scrub'" tag="kube.var.log.containers..log" time=2024-02-15 07:47:11.364141563 +0000 record={"log"=>"{"level":"info","ts":1707983231.364,

2024-02-15 07:47:12 +0000 [warn]: #0 dump an error event: error_class=NoMethodError error="undefined method =~' for 1707983231:Integer" location="/usr/lib/ruby/gems/3.2.0/gems/fluentd-1.16.3/lib/fluent/time.rb:126:in method_missing'" tag="fluent.warn" time=2024-02-15 07:47:12.353006815 +0000 record={"error"=>"#<NoMethodError: undefined method =~' for 1707983231.372:Float>", "location"=>"/usr/lib/ruby/gems/3.2.0/gems/fluent-plugin-string-scrub-1.0.1/lib/fluent/plugin/filter_string_scrub.rb:51:in with_scrub'", "tag"=>"kube.var.log.containers..log", "time"=>2024-02-15 07:47:11.372172259 +0000, "record"=>{"log"=>"{"level":"info","ts":1707983231.372,

But from the code it seems that it can work with Integer.

def recv_record(record)
scrubbed = {}
record.each do |k,v|
if v.instance_of? Hash
scrubbed[with_scrub(k)] = recv_record(v)
elsif v.instance_of? Integer
scrubbed[k] = v
else
scrubbed[with_scrub(k)] = with_scrub(v)
end
end
scrubbed
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions