I would want to construct a sentence having multiple dynamic values, for example
ruby
{
code => '
my_object =
{
"reason" => "I received event.get("baseValueUnitAmount") event.get("currency") having difference of event.get("[differenceUnitAmount]") compare to previous transaction."
}
'
}
Expected output: I received 25000 INR having difference of 5000 compare to previous transaction
one can assign event values to a variable and then pass it with #{value} inside string.
For example
ruby
{
code => '
a = event.get("baseValueUnitAmount")
b = event.get("currency")
c = event.get("[differenceUnitAmount]")
my_object =
{
"reason" => "I received #{a} #{b} having difference of #{c} compare to previous transaction."
}
'
}
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.