How to exclude XML & json key-value if key length is greater than 15 char and value length is greater than 100 char

This will be very similar to the question you asked about filtering on just the key length

ruby {
    code => '
        event.to_hash.each { |k, v|
            if k.length > 15 and v.length > 100
                event.remove(k)
            end
        }
    '
}