i am haing a csv file having 100 fields. i want to parse only 5 fields so i used Ruby filter and framed my conf. Upon executing getting {} in all lines instead of fields
Conf file
input{
file {
path => path_to_file
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
ruby {
code => "
wanted_fields = ['','']
event.to_hash.keys.each { |k|
event.remove(k) unless wanted_fields.include? k
}
"
}
}
output
{
stdout{}
}
Output:
{}
{}
{}
{}
{}
Thanks in advance