Obviously that will implode with errors about not being a * operator for NilClass if either FieldA or FieldB are missing, so you might need to test that they exist.
Yes! Badger, you are absolutely on the money. It took me a little time to understand the syntax, but your solution worked perfectly.
To anyone who may be following this post:
I initially thought that this syntax didn't work, because the value of "FieldC" was turning out to be 0 every time. But when I did some troubleshooting, I realized I misspelled "FieldA" in my command:
When Logstash goes to look for event.get("FeildA"), this returns a NULL because the field doesn't exist. the to_i function converts NULL to 0, thus throwing off the rest of the math. Once I fixed my spelling mistake, everything else worked.
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.