How to manually insert NONE value to elasticsearch index field using Logstash?


I have logfiles which contain numeric data, and I have manually created the map accordingly, specifying the number fields. But the problem is that in case if there is no data for field, log files will be generated with a - hyphen for fields having no data. This creates error since - cannot be inserted into a numeric field. To solve this, I replace the -s with 0s like below;

if [fieldA] == "-" {
	mutate {
		replace => [ "fieldA", "0" ]

even if i replace "0" with "", the field inserted is not NONE. How can I set logstash like I want to insert NONE to field if the log entry has -?

Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.