我想更新logdate
列,以查找特定索引中的所有記錄。從我目前閱讀的內容看來,這似乎是不可能的?我是對的?ElasticSearch中的更新記錄
這裏有一個文件的樣本:
{
"_index": "logstash-01-2015",
"_type": "ufdb",
"_id": "AU__EvrALg15uxY1Wxf9",
"_score": 1,
"_source": {
"message": "2015-08-14 06:50:05 [31946] PASS level2 10.249.10.70 level2 ads http://ad.360yield.com/unpixel.... GET",
"@version": "1",
"@timestamp": "2015-09-24T11:17:57.389Z",
"type": "ufdb",
"file": "/usr/local/ufdbguard/logs/ufdbguardd.log",
"host": "PROXY-DEV",
"offset": "3983281700",
"logdate": "2015-08-14T04:50:05.000Z",
"status": "PASS",
"group": "level2",
"clientip": "10.249.10.70",
"category": "ads",
"url": "http://ad.360yield.com/unpixel....",
"method": "GET",
"tags": [
"_grokparsefailure"
]
}
}
你是什麼意思的「更新」?將值更改爲其他字符串?將它轉換爲日期對象而不是字符串?將該值複製到@timestamp?要麼 ? –
我希望將logdate字段更改爲所有文檔的另一個日期。在MySQL中,我會這樣做: 'UPDATE logstash SET logdate =「2015-09-20T04:50:05.000Z」' 但是它的ElasticSearch似乎只能通過提供它的_id來更新一個文檔。 –