How update/over ride the existing ES document through Groovey


(Yogesh) #1

How to add update/override the ES document in Groovey.

This is the document injected into the ES:

'http://localhost:9200/Test/log/Sample.Test' -d '
{
"@type": "iapi.log",
"@timestamp": "2017-09-02T03:34:45.399Z",
"@source_host": "esu1l231.federated.fds",
"@message": "TEST",
"@environment": "DEV",
"@fields": {
"AppID": "DCR",
"TransactionID": "12-203-809-49181-42-131-822980900282-5242-146873621",
"CorrelationID": "6f39b6d3-85fd-44e1-b30a-bb1dced34f25",
"TransactionDomain": "Inventory",
"ElapsedTime": "0",
"AppDomain": "D2CSPF_PRD09",
"Metrics": {
"Sample.Test": "DCR_EMS_STATS_RcvToCollSales",
"TOTAL_MSGS": 2000,
"MSGS_PENDING": 12,
"MSGS_FAILED": 1100
}
}
}'

I want updated to

{
"@type": "iapi.log",
"@timestamp": "2017-09-02T03:34:45.399Z",
"@source_host": "esu1l231.federated.fds",
"@message": "TEST",
"@environment": "DEV",
"@fields": {
"AppID": "DCR1",
"TransactionID": "12",
"CorrelationID": "664546",
"TransactionDomain": "Sample",
"ElapsedTime": "0",
"AppDomain": "Test",
"Metrics": {
"Sample.Test": "DCR_EMS_STATS_RcvToCollSales",
"TOTAL_MSGS": 200,
"MSGS_PENDING": 20,
"MSGS_FAILED": 110
}
}
}'


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.