I have a JSON as follows:
{"attr1":"One", "attr2":"300"}
{"attr1":"Two","attr2":45.0}
{"attr1":"Three","attr2":"Not Set"}
attr2 is a numeric value
How do I check if attr2 is numeric, not a string before sending to elastic ?
I can check easily for the "Not Set"
if [attr2] == "Not Set"
{ drop { remove_field => [ "attr2" ] } }
but
ie. If attr is a string and is a numeric string then
convert to a number value
So any value that is not valid will transform to 0.0 ?
Is there a way to check for the non-numeric value (in case another string value gets added) ?
Rather have a NULL value than a 0.0 value
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.