Trying to get the first 4 characters of a field that is obtained via XPATH.
This is what i currently have, but it copies everything rather then the first 4 characters. Been stumped on it for the past couple hours. Open to other methods other then ruby but haven't been able to find any other suggestions
[hostdata] is a string field that is populated earlier via using the XML XPATH. I have also tried adding a mutate/convert prior to ensure that its a string.
Thanks Badger, looks like it was an array . My bad.
Solution for anyone looking for one. This only needed to be populated on certain conditions (thus the if statement). Creates the field I want populated, converts hostdata to a string, then sets message_code to the first 4 characters.
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.