# Change long field format

**URL:** <https://discuss.elastic.co/t/change-long-field-format/293049>\
**Category:** Logstash\
**Created:** [December 28, 2021, 2:20pm UTC](https://discuss.elastic.co/t/change-long-field-format/293049 "2021-12-28T14:20:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mangeshs](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mangeshs](https://discuss.elastic.co/u/mangeshs)\
**Post date:** [December 28, 2021, 2:20pm UTC](https://discuss.elastic.co/t/change-long-field-format/293049/1 "2021-12-28T14:20:29Z")

</div>

I have field called

```auto
# user_id_s:	14,960,923,573 long

```

as above name, value and type  
I want it should look like 14960923573  
I try to change its type to string by mutate convert but not worked.  
I tried creating new string and copy it to it but still not worked any other option

---

<div class="post-metadata">

**Author:** ![yaauie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaauie/32/23363_2.png) [@yaauie](https://discuss.elastic.co/u/yaauie)\
**Post date:** [December 28, 2021, 7:57pm UTC](https://discuss.elastic.co/t/change-long-field-format/293049/2 "2021-12-28T19:57:59Z")

</div>

Logstash doesn't have any datatypes that serialize to `14,960,923,573 long`. What format is this coming in as? Is it a string of characters (`1` `4` `,` `9` `6` `0` `,` `9` `2` `3` `,` `5` `7` `3` SPACE `l` `o` `n` `g`)?

If so, the following should work by replacing any comma surrounded by digits, or any trailing `<SPACE> long`, with an empty string:

```auto
filter { mutate { gsub => ["user_id_s", "(?:(?<=[0-9]),(?=[0-9]))|(?: long$)", ""] } }

```

---

<div class="post-metadata">

**Author:** ![mangeshs](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@mangeshs](https://discuss.elastic.co/u/mangeshs)\
**Post date:** [December 29, 2021, 7:12am UTC](https://discuss.elastic.co/t/change-long-field-format/293049/3 "2021-12-29T07:12:09Z")

</div>

NO. Its a long value coming as follows in discover of kibana

```auto
14,960,923,573 

```

I just want a long value or string value as

14960923573

---

<div class="post-metadata">

**Author:** ![FALEN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/falen/32/82754_2.png) [@FALEN](https://discuss.elastic.co/u/FALEN)\
**Post date:** [December 29, 2021, 12:24pm UTC](https://discuss.elastic.co/t/change-long-field-format/293049/4 "2021-12-29T12:24:18Z")

</div>

Can you check kibana index options, there might you able to remove those extra commas

Stack Management -\> Kibana Index Patterns -\> Your index -\> Your field "Set Format" = "0"

this will remove commas, but keep that in mind, this is only for kibana

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/3/83f5468917358f66bb786832b5383cd0649f7edd.png)

---

<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:** [January 26, 2022, 12:24pm UTC](https://discuss.elastic.co/t/change-long-field-format/293049/5 "2022-01-26T12:24:41Z")

</div>

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