Problem with output elasticsearch data duplicate on index

You can use the add_field parameter in the input to create a data_type field and then your conditional in the output section.