# Logstash Extractnumbers plugin usage

**URL:** https://discuss.elastic.co/t/logstash-extractnumbers-plugin-usage/205876
**Category:** Logstash
**Created:** [October 30, 2019, 2:24pm UTC](https://discuss.elastic.co/t/logstash-extractnumbers-plugin-usage/205876 "2019-10-30T14:24:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![angryninja](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@angryninja](https://discuss.elastic.co/u/angryninja)
#### Post date: [October 30, 2019, 2:24pm UTC](https://discuss.elastic.co/t/logstash-extractnumbers-plugin-usage/205876/1 "2019-10-30T14:24:29Z")

</div>

Hi there,  
I have started using Logstash just recently. How do I make use of Extractnumbers plugin with Logstash ?  
I can find its usage with options but don't seem to find the simplest example of a basic use case of extracting numbers from a string.

---

<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: [October 30, 2019, 2:33pm UTC](https://discuss.elastic.co/t/logstash-extractnumbers-plugin-usage/205876/2 "2019-10-30T14:33:52Z")

</div>

It's just pattern matching. Here is an example

```
input { generator { count => 1 lines => ['12 10.1 foo 5 10.2 10'] } }
filter { extractnumbers {} }
output { stdout { codec => rubydebug { metadata => false } } }

```

produces

```
      "int3" => 10,
    "float2" => 10.2,
      "int2" => 5,
      "int1" => 12,
    "float1" => 10.1
```

---

<div class="post-metadata">

### Author: ![angryninja](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@angryninja](https://discuss.elastic.co/u/angryninja)
#### Post date: [October 31, 2019, 8:50pm UTC](https://discuss.elastic.co/t/logstash-extractnumbers-plugin-usage/205876/3 "2019-10-31T20:50:02Z")

</div>

Thank you !

---

<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: [November 28, 2019, 8:50pm UTC](https://discuss.elastic.co/t/logstash-extractnumbers-plugin-usage/205876/4 "2019-11-28T20:50:11Z")

</div>

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