# How to get integer field with comma-seperator to add\_field

**URL:** <https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818>\
**Category:** Logstash\
**Created:** [April 20, 2020, 8:57am UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818 "2020-04-20T08:57:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phornkrit\_Hirunyanit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phornkrit_hirunyanit/32/66656_2.png) [@Phornkrit\_Hirunyanit](https://discuss.elastic.co/u/Phornkrit_Hirunyanit)\
**Post date:** [April 20, 2020, 8:57am UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818/1 "2020-04-20T08:57:04Z")

</div>

Hello Developer, I have some issue for ask you all  
I tried to get field  
`%{NUMBER:linenr:int}`  
This is the results  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/5/35f2be8d47801491310f94b6681404dc004e3a0f.png)

At add\_field

```auto
mutate{
         add_field => { 
"linenrMeassage" => "%{fact_or_dim}: %{linenr} rows loaded" }  
            }

```

This is the results  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/2/929aa57afbe84a61e2da13260acb323355b50215.png)

at lineMessage I want %{linenr} with comma-seperator

PS. I tried to do this result but it's not working and I also  
`convert => {"linenr" => "integer"}`  
It's not working too

Help me please

Regards

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 20, 2020, 3:18pm UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818/2 "2020-04-20T15:18:24Z")

</div>

The [linenr] field is an integer. The comma is being added in the presentation layer by kibana. If you want to format the number with commas I think you will need to use a ruby filter.

---

<div class="post-metadata">

**Author:** ![Phornkrit\_Hirunyanit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phornkrit_hirunyanit/32/66656_2.png) [@Phornkrit\_Hirunyanit](https://discuss.elastic.co/u/Phornkrit_Hirunyanit)\
**Post date:** [April 21, 2020, 4:20am UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818/3 "2020-04-21T04:20:00Z")

</div>

Thank you for replying me @Badger .  
I've tried your solution but It's not working.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/f/cfaa544a9462b15612b56c5b57c6de5cf905d634.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/0/30917c30be56945940addf7c7451a0474e7b1f50.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/3/838578ce716f70e2663f2d4cc506cfbe233633db.png)

Could you tell me what I should to do?

Regards

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [April 21, 2020, 3:51pm UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818/4 "2020-04-21T15:51:17Z")

</div>

You need more complicated ruby code than that. See [here](https://codereview.stackexchange.com/questions/28054/separate-numbers-with-commas) for example.

---

<div class="post-metadata">

**Author:** ![Phornkrit\_Hirunyanit](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phornkrit_hirunyanit/32/66656_2.png) [@Phornkrit\_Hirunyanit](https://discuss.elastic.co/u/Phornkrit_Hirunyanit)\
**Post date:** [April 21, 2020, 4:13pm UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818/5 "2020-04-21T16:13:07Z")

</div>

Thank you @Badger  
I will try it 😄 .

---

<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:** [May 19, 2020, 4:13pm UTC](https://discuss.elastic.co/t/how-to-get-integer-field-with-comma-seperator-to-add-field/228818/6 "2020-05-19T16:13:24Z")

</div>

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