# Can we index .zip file using ingest attachment plugin?

**URL:** <https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710>\
**Category:** Elasticsearch\
**Created:** [March 18, 2019, 6:27am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710 "2019-03-18T06:27:24Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 18, 2019, 6:27am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/1 "2019-03-18T06:27:24Z")

</div>

Hi,

As we can indexed .txt, .xlsx, .pptx , .pdf files using ingest attachment plugin. Can we indexed zip files using same plugin? I tried it but i don’t see attachment content is getting indexed.  
Can anyone help me with this?

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 18, 2019, 8:23am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/2 "2019-03-18T08:23:54Z")

</div>

No I don't think you can.

FSCrawler supports it though.  
But in any case I think you should unzip your files instead. There are many cons of indexing zip files:

- memory usage when extracting big zip files
- the fact that if you have tons of files within your zip, it will be hard for the end user knowing which inner file contains the text.

My 2,cents

---

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 22, 2019, 10:00am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/3 "2019-03-22T10:00:46Z")

</div>

Hi @dadoonet,

Thanks for your reply.  
I am trying to index files using FSCrawler. FSCrawler will propose to create your first job. i have created job using 'FSCrawler job\_name'.  
Now trying to perform step as mentioned, but it is again asking me to create job\_name.  
$ bin/fscrawler --config\_dir ./test job\_name

after config\_dir which path you should provide?

Could you please help me with this?

Thanks,  
Priyanka.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 22, 2019, 11:04am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/4 "2019-03-22T11:04:56Z")

</div>

`config_dir` is where you want to store FSCrawler config files.  
It can be whatever you want.

If you don't define `config_dir`, it will use a default location (your `home directory/.fscrawler`).  
So you can just run:

```auto
$ bin/fscrawler job_name

```

To create an empty job.

And

```auto
$ bin/fscrawler job_name

```

To run the job then.

---

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 22, 2019, 11:25am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/5 "2019-03-22T11:25:30Z")

</div>

Hi @dadoonet,

Thanks for your reply!!!  
I tried to run new created job but i am getting below error for ES client version :

```auto
E:\fscrawler-es7-2.7-20190218.195814-11\fscrawler-es7-2.7-SNAPSHOT\bin>fscrawler test
11:09:46,562 WARN [f.p.e.c.f.c.v.ElasticsearchClientV7] failed to create elasticsearch client,disabling crawler...
11:09:46,562 FATAL [f.p.e.c.f.c.FsCrawlerCli] We can not start Elasticsearch Client. Exiting.java.lang.RuntimeException: The Elasticsearch client version [7] is not compatible with the Elasticsearch cluster version [6.6.1].at fr.pilato.elasticsearch.crawler.fs.client.v7.ElasticsearchClientV7.checkVersion(ElasticsearchClientV7.java:183) ~[fscrawler-elasticsearch-client-v7-2.7-SNAPSHOT.jar:?]atfr.pilato.elasticsearch.crawler.fs.client.v7.ElasticsearchClientV7.start(ElasticsearchClientV7.java:142) ~[fscrawler-elasticsearch-client-v7-2.7-SNAPSHOT.jar:?]at fr.pilato.elasticsearch.crawler.fs.cli.FsCrawlerCli.main(FsCrawlerCli.java:263) [fscrawler-cli-2.7-SNAPSHOT.jar:?]
11:09:46,562 INFO [f.p.e.c.f.FsCrawlerImpl] FS crawler [test] stopped
11:09:46,562 INFO [f.p.e.c.f.FsCrawlerImpl] FS crawler [test] stopped 

```

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 22, 2019, 11:52am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/6 "2019-03-22T11:52:15Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.

I updated your post.

Didn't you see this?

> We can not start Elasticsearch Client. Exiting.java.lang.RuntimeException: The Elasticsearch client version [7] is not compatible with the Elasticsearch cluster version [6.6.1].

You need to download the right version as [the documentation](https://fscrawler.readthedocs.io/en/latest/installation.html) says:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/f/df3cd083922563475a3d4141108e7ad414e0a5ca.png)

---

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 27, 2019, 6:54am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/8 "2019-03-27T06:54:32Z")

</div>

Hi @dadoonet,

Thanks for your reply!!!  
I have created job and ran job which is indexing files mentioned in folder (\tmp\es). I have created index pattern and try to discover it. I am not able to see attachment content is being indexed. So how will I able to know that all the attachments, I have added to folder is getting indexed?

Kindly guide me on this more.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 27, 2019, 8:13am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/9 "2019-03-27T08:13:58Z")

</div>

Could you run in Kibana dev console:

```auto
GET /_cat/indices?v
GET /test/_search

```

---

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 27, 2019, 8:47am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/10 "2019-03-27T08:47:15Z")

</div>

Hi @dadoonet,

Yes now I can see doc is indexed. But how I can see indexed attachment content in discover section?  
I have created index pattern but not able see content of attachment in discover like mapper attachment.

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 27, 2019, 9:02am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/11 "2019-03-27T09:02:36Z")

</div>

Can you share the output of the commands I pasted?

---

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 27, 2019, 9:29am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/12 "2019-03-27T09:29:55Z")

</div>

Hi @dadoonet,

Please find attached document.

 ![1stcommand](https://us1.discourse-cdn.com/elastic/original/3X/c/2/c256f0ee0908b0a8f284282a0350ffeb3afaba31.png) ![2ndcommand](https://us1.discourse-cdn.com/elastic/original/3X/e/c/ecd0fe0b5aa6eba863949b7fc49759ce18397baa.png)

Thanks,  
Priyanka

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 27, 2019, 12:03pm UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/13 "2019-03-27T12:03:39Z")

</div>

Please don't post images of text as they are hardly readable and not searchable.

Instead paste the text and format it with `</>` icon. Check the preview window.

---

<div class="post-metadata">

**Author:** ![pyerunka](https://avatars.discourse-cdn.com/v4/letter/p/d6d6ee/32.png) [@pyerunka](https://discuss.elastic.co/u/pyerunka)\
**Post date:** [March 28, 2019, 5:32am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/14 "2019-03-28T05:32:04Z")

</div>

Hi @dadoonet,

Thanks for your help!!  
This issue has been resolved now. I am able to index zip files and can discover index pattern using kibana. and able to see attachment content also.

one more question regarding FSCrawler is can we provide database connection using FSCrawler so that files can be indexed using database file path?

Could you please guide me?

Thanks,  
Priyanka Yerunkar

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2019, 5:32am UTC](https://discuss.elastic.co/t/can-we-index-zip-file-using-ingest-attachment-plugin/172710/15 "2019-04-25T05:32:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
