1.select streamId,flowId, dataGeneratedTs,dataProcessTs,doneTs,feedbackTime,rddTs,sinkTs,swiftsTs,(dataProcessTs-dataGeneratedTs)/1000 as receivedDelay from wormhole_feedback_2_adx where flowId = 23704 and dataProcessTs >= "2020-12-08 11:00:00.000000+0800" and dataProcessTs <= "2020-12-08 12:00:00.000000+0800" order by dataGeneratedTs desc limit 3
GET /wormhole_feedback_2_adx/_search
{
"size": 20,
"_source": {
"includes": [
"streamId",
"flowId",
"dataGeneratedTs",
"dataProcessTs"
]
},
"query": {
"bool": {
"must": [
{
"match": {
"flowId": 23704
}
},
{
"range": {
"dataProcessTs": {
"gte": "2020-12-08 09:30:00.000000+0800",
"lte": "2020-12-08 11:15:00.000000+0800"
}
}
}
]
}
},
"sort": [
{
"dataGeneratedTs":{
"order": "desc"
}
}
],
"script_fields": {
"receivedDelay": {
"script": {
"source": "(doc.dataProcessTs.date.millis - doc.dataGeneratedTs.date.millis)/1000"
}
}
}
}