# How to replace comma with double quotes in Elasticsearch ingest pipeline?

**URL:** https://discuss.elastic.co/t/how-to-replace-comma-with-double-quotes-in-elasticsearch-ingest-pipeline/319807
**Category:** Elasticsearch
**Created:** [November 25, 2022, 10:05am UTC](https://discuss.elastic.co/t/how-to-replace-comma-with-double-quotes-in-elasticsearch-ingest-pipeline/319807 "2022-11-25T10:05:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![niveditakathal](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@niveditakathal](https://discuss.elastic.co/u/niveditakathal)
#### Post date: [November 25, 2022, 10:05am UTC](https://discuss.elastic.co/t/how-to-replace-comma-with-double-quotes-in-elasticsearch-ingest-pipeline/319807/1 "2022-11-25T10:05:20Z")

</div>

Hi Experts,

Could you please assist me on how I can format the field value in Elasticsearch? I tried gsub under ingest pipeline , but it is not working as expected.

code

```auto
"gsub": {
        "field": "destination",
        "pattern": ",",
        "replacement": "\",\""
      }

```

Actual field value /input to ingest pipeline

```auto
"destination" : "Test01@gamil.com,Test02@gamil.com"

```

Field value inserted into elastic document using above code

```auto
"destination" : """Test01@gamil.com","Test02@gamil.com"""

```

Desire output

```auto
"destination" : "Test01@gamil.com","Test02@gamil.com"

```

Note : I also tried pattern\_replace analyzer but no luck

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/0/e08f761703c8f9cd7b9161289db061a509adbdb3.png)

Thanks and regards,  
Nivedita

---

<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: [December 23, 2022, 10:05am UTC](https://discuss.elastic.co/t/how-to-replace-comma-with-double-quotes-in-elasticsearch-ingest-pipeline/319807/2 "2022-12-23T10:05:46Z")

</div>

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