Hey everyone,
i have two fileds in a csv file dump_status and upload_status then i added a third field called return_code. the values of upload_status and dump_status are copy complete and
copy failed. what i need to is the assign 1 to return code when the two fields have copy complete as value and 0 to other conditions. here's my filter:
filter {
if [type] == "test_parser" {
csv {
columns => ["dump","dump-status","copy","upload","up_status"]
separator => ";"
remove_field => ["dump","upload"]
add_field => { "tech_return_code" => "-" }
}
if ([dump_status] == "Copy complete" and [up_status] == "Copy complete") {
mutate {
gsub => [ "tech_return_code" , "-" , "1" ]
}}
if ([dump_status] != "Copy complete" or [up_status] != "Copy complete") {
mutate {
gsub => [ "tech_return_code" , "-" , "0" ]
}}
mutate {
convert => [ "tech_return_code" , "integer" ]
}
}}
it didn't worked when i am testing it with the 4 cases any help please
thanks!