1.导出articleKey字段不为空的数据:

elasticdump --input=http://elastic:elastic@127.0.0.1:9310/easysite_behavior_data_index --output=easysite_behavior_data_index.json --searchBody '{"query": {"bool": {"must_not": [{"term": {"articleKey.keyword": {"value": ""}}}]}}}'

2.导出articleKey字段不为空,一次导出5000条,文件大小5G,重连次数5次

elasticdump --limit 5000 --input=http://elastic:elastic@127.0.0.1:9310/easysite_behavior_data_index --output=easysiteDate.json --fileSize=5120mb --retryAttempts=5 --searchBody '{"query": {"bool": {"must_not": [{"term": {"articleKey.keyword": {"value": ""}}}]}}}'

3.导出某个时间段内,articleKey字段不为空

elasticdump --input=http://elastic:elastic@127.0.0.1:9310/easysite_behavior_data_index --output=easysite_behavior_data_index2.json --searchBody '{"query": {"bool": {"must": [{"range": {"createDate.keyword": {"gte": "2021-10-20 00:00:00","lte": "2022-10-09 00:00:00","format": "yyyy-MM-dd HH:mm:ss"}}}],"must_not": [{"term": {"articleKey.keyword": {"value": ""}}}]}}}'

4.参数介绍:

http://elastic:elastic——es中的账号密码

@127.0.0.1:9310/easysite_behavior_data_index——@后面跟的是es安装的服务器地址,9310是es端口,easysite_behavior_data_index是你要导出数据的es索引

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐