ruby {
code => "
hash = event.to_hash
hash.each do |k,v|
if v == 'undefined-'
event.remove(v)
end
end
"
}
ruby {
code => "
hash = event.to_hash
hash.each do |k,v|
if v == '[-]*undefined'
event.remove(v)
end
end
"
}
today I've tried also the new one code but get the same result. I don't know where the is the root cause.
ruby {
code => "
def stripit(value)
value.gsub!('[-]*undefined','')
value
end
hash = event.to_hash
hash.each do |k,value|
if value == '[-]*undefined'
stripit(value)
end
end
"
}
ruby {
code => "
def stripito(value)
value.gsub!('undefined-','')
value
end
hash = event.to_hash
hash.each do |k,value|
if value == 'undefined-'
stripito(value)
end
end
"
}
ruby {
code => "
hash = event.to_hash
hash.each do |k,v|
if v == '[-]*undefined'
event.set(k, v.gsub!('[-]*undefined',''))
end
end
"
}
ruby {
code => "
hash = event.to_hash
hash.each do |k,v|
if v == 'undefined-'
event.set(k, v.gsub!('undefined-',''))
end
end
"
}
@Badger Can You keep an eye? on this ->
Do You have any idea? Please note that all these fields are strings
ok now it's clear ruby has a problem with regex so I user another method
" Using include? method from string"
ruby {
code => "
hash = event.to_hash
hash.each do |k,v|
if v.is_a? String
if v.include? 'undefined-'
event.set(k, v.gsub!('undefined-',''))
end
end
end
"
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.