wxf4150 / esdump

elasticserch dump import export
8 stars 5 forks source link

Export data is empty when the --c parameter is not used #4

Closed kerven88 closed 2 years ago

kerven88 commented 2 years ago

Export data is empty when the --c parameter is not used,log display: "total_raw_bytes: 0.00 MB"。

My export command: [root@ip~]# /opt/esdump export \

--es http://127.0.0.1:9200 \
--index forseti-r-20211118 \
--gzip=false \
--o /tmp/tmp.json \
--MatchBody '{"range": {"activity.S_T_VD_EVENTOCCURDATE.raw": {"gte": "2021-11-18", "lt": "2021-11-19"}}}'

2021/11/19 06:10:16 execute export 2021/11/19 06:10:16 export index forseti-r-20211118 to /tmp/tmp.json 2021/11/19 06:10:16 init elasticsearch Client with url: http://127.0.0.1:9200 2021/11/19 06:10:16 export match: {"range": {"activity.S_T_VD_EVENTOCCURDATE.raw": {"gte": "2021-11-18", "lt": "2021-11-19"}}} 2021/11/19 06:10:16 total exported 1 items; total_raw_bytes: 0.00 MB; 2021/11/19 06:10:16 export time spend 107.544834ms

When there is data after adding the --c parameter, and the amount of exported data varies with the size of the parameter, what is the function of the --c parameter?

wxf4150 commented 2 years ago

-c parameter set the max amount of documents to be exported; default(0) will exported all matched document;

pre-commit,the MaxDocs parameter( -c parameter) ,with default(0) vlaue will export none data. it's a bug i have fix the bug .

@kerven88