Check if csv parse failed/ Change record type


I need logic in my file input filter such that if a csv parse fails I can catch that and change the record type. This is the structure I have


csv {
add_tag = > 'OK'

//How would I check if tag above is present here? And is it possible to change the record type?


read up on conditionals

if [type] =~ /mytype/ {
# do something