elasticdump导出数据
elasticdump导出数据
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索引
更多推荐
所有评论(0)