# Can I parse text in pdf document before sending it to elasticsearch using FSCrawler

**URL:** https://discuss.elastic.co/t/can-i-parse-text-in-pdf-document-before-sending-it-to-elasticsearch-using-fscrawler/182564
**Category:** Elasticsearch
**Created:** [May 24, 2019, 5:58am UTC](https://discuss.elastic.co/t/can-i-parse-text-in-pdf-document-before-sending-it-to-elasticsearch-using-fscrawler/182564 "2019-05-24T05:58:35Z")
**Posts on this page:** 1
**Showing post:** 5

<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: [May 24, 2019, 6:46am UTC](https://discuss.elastic.co/t/can-i-parse-text-in-pdf-document-before-sending-it-to-elasticsearch-using-fscrawler/182564/5 "2019-05-24T06:46:35Z")

</div>

> [@Vishnu\_mk](#):
>
> Like if I want to extract Phone no. from the pdf.

Now I understand the question.  
So it's not related to FSCrawler but more a general question on how I can extract a phone number from a text, right?

I mean that FSCrawler is responsible to extract the text from a PDF.  
Once done, you can do whatever with the extracted text.

Here I'd probably try to use an ingest pipeline (which you can define later in FSCrawler with [Elasticsearch settings — FSCrawler 2.10-SNAPSHOT documentation](https://fscrawler.readthedocs.io/en/latest/admin/fs/elasticsearch.html#ingest-node)) to try to apply some regex on your text.

You can try the Grok processor may be: [Grok processor | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html)

If you have further questions, please provide an example of what you tried so far, without using FSCrawler. As I said, that's not FSCrawler's responsability doing that. Like (but for another use case):

```auto
POST _ingest/pipeline/_simulate
{
  "pipeline": {
  "description" : "parse multiple patterns",
  "processors": [
    {
      "grok": {
        "field": "message",
        "patterns": ["%{FAVORITE_DOG:pet}", "%{FAVORITE_CAT:pet}"],
        "pattern_definitions" : {
          "FAVORITE_DOG" : "beagle",
          "FAVORITE_CAT" : "burmese"
        }
      }
    }
  ]
},
"docs":[
  {
    "_source": {
      "message": "I love burmese cats!"
    }
  }
  ]
}

```

---

_[View the full topic](https://discuss.elastic.co/t/can-i-parse-text-in-pdf-document-before-sending-it-to-elasticsearch-using-fscrawler/182564)._
