jprante/elasticsearch-knapsack — pull request #53 by rtkmhart (2014-10-01 13:21:59+00:00)
Title: Ignore directory entries in tar files

If an exported tar file is pulled apart and put back together using the regular 'tar' tools, the tar file will include directory entries. The knapsack plugin doesn't handle that gracefully and blows up with something like

`
org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: type is missing;2: type is missing;3: type is missing;
`

The fix is to ignore directory entries, or packets with zero length payloads.

Some more background, a tar file made by the knapsack export might look like (viewed with `tar tzvf ...`

`
-rw-r--r-- vagrant/vagrant 554 2014-09-30 17:15 infralogs-2014.09.28/sshd/zW1Nhc5NSm-7Kotn8Xw05g/_source
`

And once that tar file has been extracted using `tar xzvf ...` and recreated using `tar czf ...` it will look like:

```
drwxrwxr-x vagrant/vagrant 0 2014-09-30 19:40 infralogs-2014.09.28/sshd/
drwxrwxr-x vagrant/vagrant 0 2014-09-30 19:40 infralogs-2014.09.28/sshd/zW1Nhc5NSm-7Kotn8Xw05g/
-rw-r--r-- vagrant/vagrant 554 2014-09-30 17:15 infralogs-2014.09.28/sshd/zW1Nhc5NSm-7Kotn8Xw05g/_source
```
but the import assumes that every entry in the tarfile is a valid json object.