我的CSV文件包含的字段为nil,如下所示:
{ "message" => [
[0] "m_FRA-LIENSs-R2012-1;r"
],
"@version" => "1",
"@timestamp" => "2015-05-24T13:51:14.735Z",
"host" => "debian",
"SEXTANT_UUID" => "m_FRA-LIENSs-R2012-1",
"SEXTANT_ALTERNATE_TITLE" => nil
}
How can I remove all : messages and fields
这是我的CSV文件
SEXTANT_UUID|SEXTANT_ALTERNATE_TITLE
a1afd680-543c | ZONE_ENJEU
4b80d9ad-e59d | ZICO
800d640f-1f82 |
我想删除最后一行,我使用ruby过滤器,但它不起作用!它只删除字段,而不是整个消息
如果您像这样配置Ruby过滤器,它将工作:
filter {
# let ruby check all fields of the event and remove any empty ones
ruby {
code => "event.to_hash.delete_if {|field, value| value.blank? }"
}
}
我使用if ([message]=~ "^;") {drop {}} ans它的工作=>对于csv文件