# How to parse long numbers?

**URL:** https://discuss.elastic.co/t/how-to-parse-long-numbers/288783
**Category:** Logstash
**Created:** [November 9, 2021, 3:41pm UTC](https://discuss.elastic.co/t/how-to-parse-long-numbers/288783 "2021-11-09T15:41:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rachelyang](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@rachelyang](https://discuss.elastic.co/u/rachelyang)
#### Post date: [November 9, 2021, 3:41pm UTC](https://discuss.elastic.co/t/how-to-parse-long-numbers/288783/1 "2021-11-09T15:41:20Z")

</div>

I have set up NUMBER type for item duration in the pattern of Logstash configuration as  
%{NUMBER:Duration}  
It can parse most of the numbers in the log files, like 9994568.872 , 20903.23, etc..  
But it cannot parse the long numbers which contains letter 'E', like 1.1280996562E7  
How shall I set the type of Duration? And I prefer to use number type. Do we have any replacement in Logstash?  
Thanks,

---

<div class="post-metadata">

### Author: ![AquaX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aquax/32/92006_2.png) [@AquaX](https://discuss.elastic.co/u/AquaX)
#### Post date: [November 17, 2021, 1:29pm UTC](https://discuss.elastic.co/t/how-to-parse-long-numbers/288783/2 "2021-11-17T13:29:46Z")

</div>

Logstash is handling this field as a string by default. Have you tried converting the scientific notation field to a float using the mutate filter?  
I believe that Elasticsearch is then able to automatically deal with scientific notation if it is sent in as not a string.

```auto
    filter {
      mutate {
        convert => {
          "duration" => "float"
        }
      }
    }

```

---

<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 15, 2021, 1:30pm UTC](https://discuss.elastic.co/t/how-to-parse-long-numbers/288783/3 "2021-12-15T13:30:03Z")

</div>

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