How to extract data from multiline(codec)

If measData is an object, then see here. If you want to remove a prefix from the key name you could try

ruby {
    code => '
        event.to_hash.each { |k, v|
            if k =~ /^measData\./
                newK = k.sub(/^measData\./, "")
                event.set(newK, event.remove(k))
            end
        }
    '
}
1 Like