# LogStash::Json::ParserError: Invalid numeric value: Leading zeroes not allowed

**URL:** https://discuss.elastic.co/t/logstash-invalid-numeric-value-leading-zeroes-not-allowed/186150
**Category:** Logstash
**Tags:** elastic-stack-monitoring
**Created:** [June 17, 2019, 7:54pm UTC](https://discuss.elastic.co/t/logstash-invalid-numeric-value-leading-zeroes-not-allowed/186150 "2019-06-17T19:54:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![valleram](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/valleram/32/48248_2.png) [@valleram](https://discuss.elastic.co/u/valleram)
#### Post date: [June 17, 2019, 7:54pm UTC](https://discuss.elastic.co/t/logstash-invalid-numeric-value-leading-zeroes-not-allowed/186150/1 "2019-06-17T19:54:03Z")

</div>

Hi,  
I'm trying to parse some json strings which contain an integer field with the value `duration":0000`.  
I tried to convert it to string type but didn't work. I'm still receiving the following error.

`#<LogStash::Json::ParserError: Invalid numeric value: Leading zeroes not allowed`

I used this configuration in the logstash.conf file

`filter { json{ source => "message" } mutate { convert => { "duration" => "string" } } }`

Can you help me?

---

<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: [June 17, 2019, 8:42pm UTC](https://discuss.elastic.co/t/logstash-invalid-numeric-value-leading-zeroes-not-allowed/186150/2 "2019-06-17T20:42:18Z")

</div>

Try running [this](https://discuss.elastic.co/t/trying-to-add-ruby-filter-to-remove-leading-zero/168901/4) filter _before_ you parse the JSON. It might need tweaking to make the pattern more specific.

---

<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: [July 15, 2019, 8:42pm UTC](https://discuss.elastic.co/t/logstash-invalid-numeric-value-leading-zeroes-not-allowed/186150/3 "2019-07-15T20:42:18Z")

</div>

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