Enniu_51
(Sayakiss)
October 22, 2015, 5:54am
5
Wow, that works!
But I feel strange, because @spinscale gave me such a transform:
"transform" : {
"script" : "time = org.joda.time.format.ISODateTimeFormat.dateTime().withZone(org.joda.time.DateTimeZone.forID(\"Europe/Berlin\")).parseDateTime(ctx.trigger.triggered_time.toString()).toString() ; return [ time_as_string : time ]"
}
Why he use org.joda.time.format.ISODateTimeFormat
there?
relate post:
Hey there,
you can use the the joda date time formatters to do this. This is just a quick test and it worked, I think you can do this more efficiently.
curl -XPUT 'http://localhost:9200/_watcher/watch/log_error_watch' -d '{
"trigger" : { "schedule" : { "interval" : "10s" } },
"input" : {
"search" : {
"request" : {
"indices" : [ "logs" ],
"body" : {
"query" : {
"match" : { "message": "error" }
}
}
}
}
},
"action…