HI All,
I have the below filter in logstash
if([orderstatuscode]=="1"){
mutate{
add_field => ["status","Accept"]
}
}
else if([orderstatuscode]=="2"){
mutate{
add_field => ["status","Ready"]
}
}
else if([orderstatuscode]=="7"){
mutate{
add_field => ["status","Cancel"]
}
}
i am checking the value of a field and based on that adding an additional field. Is there a way i can store the value in a temporary field and write the mutate filter once? Something like this,
if([orderstatuscode]=="05"){
status="Accept"
}
else if([orderstatuscode]=="10"){
status="Ready"
}
mutate{
add_field => ["status",status]
}
Tried this,but was giving error...