Hi, I have a watcher with the transform and parser files which I need to migrate from groovy to painless but I am getting some error.
The transform file is below which needs to be migrated from groovy to painless, anyone could help in migration is greatly appreciated!!
def op
if ( ipval == "emvipperr" )
{
def bck = ctx.payload.aggregations.dateRange.buckets[0]
op = "
EMV IPP Error Details:
"
op += "
Time
"
op += "
User Id
"
op += "
Count
"
bck.timeRange.buckets.each {
k ->
def millis = ky
def timeofOcc = new Date(millis).format("yyyy-MM-dd HH:mm:ss.SSS")
k.user_Id.buckets.each {
ki ->
op += "<tr><td style='padding:5px;padding-left:20px;padding-right:20px;background-color:#F9F9F9'>${timeofOcc}</td>"
op += "<td style='padding:5px;padding-left:20px;padding-right:20px;background-color:#F9F9F9'>${ki.key}</td>"
op += "<td style='padding:5px;padding-left:20px;padding-right:20px;background-color:#F9F9F9'>${ki.doc_count}</td></tr>"
}
}
op += "</table><br><br><i>This is system generated alert. Please do not reply.</i><div>"
Hey @ganga,
can you please reformat your post using [code][/code] because I cannot read and understand what is the code and what the returned error.
Thanks
The below transform file which is written in groovy needs to be migrated from groovy to painless, any help in migration is appreciated.
def op
if ( ipval == "emvipperr" )
{
def bck = ctx.payload.aggregations.dateRange.buckets[0]
op = "EMV IPP Error Details"
op += "Time"
op += "User"
op += "Count"
bck.timeRange.buckets.each {
k ->
def millis = ky
def timeofOcc = new Date(millis).format("yyyy-MM-dd HH:mm:ss.SSS")
k.user_Id.buckets.each {
ki ->
op += "<tr><td style='padding:5px;padding-left:20px;padding-right:20px;background-color:#F9F9F9'>${timeofOcc}</td>"
op += "<td style='padding:5px;padding-left:20px;padding-right:20px;background-color:#F9F9F9'>${ki.key}</td>"
op += "<td style='padding:5px;padding-left:20px;padding-right:20px;background-color:#F9F9F9'>${ki.doc_count}</td></tr>"
}
}
op += "</table><br><br><i>This is system generated alert. Please do not reply.</i><div>"
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.