Skip to content

Add document count check option to Reindex action #1299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
untergeek opened this issue Oct 24, 2018 · 4 comments
Open

Add document count check option to Reindex action #1299

untergeek opened this issue Oct 24, 2018 · 4 comments

Comments

@untergeek
Copy link
Member

For some users, a reindex should be able to verify the before and after document count.

This could be true for a queried reindex (hopefully a clever way to get the document count for such a query could be realized) to verify that the target has the expected document count.

This could be true for a many to one reindex (get doc counts on all source indices, local or remote).

Make a flag to do a source to dest doc count check

@rahst12
Copy link

rahst12 commented Oct 31, 2018

This would be very useful for what I'm doing right now. We're looking at implementing this with a bash script in the meantime. If you (@untergeek) have a workaround, I'd love to see it.

@dudubis
Copy link

dudubis commented Nov 19, 2018

Short one liner until this gets committed:
curl -s "http://localhost:9200/_cat/indices/$INDEX?v&h=docs.count&pretty" | awk '{s+=$1}END{print s}'
Where INDEX='logstash-2018.11.*'

This will return the sum of docs.count for all daily indices. Later you can run the same command on the new reindexed index and compare the two sums.

@untergeek
Copy link
Member Author

Have you followed #1291? This PR may be merged at some point, but it will have to be optional. If the author of that would change it to be optional, I’d be able to merge it sooner.

@rahst12
Copy link

rahst12 commented Nov 21, 2018

Optional would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants