# Regex to integer\\float

**URL:** https://discuss.elastic.co/t/regex-to-integer-float/54333
**Category:** Logstash
**Created:** [June 29, 2016, 8:54pm UTC](https://discuss.elastic.co/t/regex-to-integer-float/54333 "2016-06-29T20:54:53Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [June 30, 2016, 8:48am UTC](https://discuss.elastic.co/t/regex-to-integer-float/54333/3 "2016-06-30T08:48:38Z")

</div>

See this response from earlier this morning:

> [@Gsub specific characters but not all of them in value](https://discuss.elastic.co/t/gsub-specific-characters-but-not-all-of-them-in-value/53909/4):
>
> You'll have to use a ruby filter for that. Something similar to ruby { code =\> " event.to\_hash.each { |k, v| event[k] = v.to\_f if k.start\_with? 'metric-' } " } should work.

---

_[View the full topic](https://discuss.elastic.co/t/regex-to-integer-float/54333)._
