我的CSV文件包含的字段类似于:
{ "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,但它不起作用!它只删除字段而不是整个消息。
答案 0 :(得分:1)
如果您像这样配置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? }"
}
}
答案 1 :(得分:0)
我使用if([message] =〜“^;”){drop {}} ans it's work =>对于csv文件