How to use .conut to exclude a character from the .length count?

Currently it does the account but does not delete the "/".

ruby {
    		code => '
        		event.set("execution_length_input", event.get("[execution][input]").to_s.length - 
                        ("[execution][input]").to_s.count("\") )

You could try

        code => '
            e = event.get("[execution][input]")
            if e
                event.set("execution_length_input", e.to_s.delete("/").length)

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.