# Ruby Filter - Preserving Case

**URL:** <https://discuss.elastic.co/t/ruby-filter-preserving-case/125847>\
**Category:** Logstash\
**Created:** [March 28, 2018, 4:22am UTC](https://discuss.elastic.co/t/ruby-filter-preserving-case/125847 "2018-03-28T04:22:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [March 28, 2018, 4:22am UTC](https://discuss.elastic.co/t/ruby-filter-preserving-case/125847/1 "2018-03-28T04:22:34Z")

</div>

Update: I'm being careless, I had the field listed in a mutate\>lowercase function later on in the pipe 🙄

Ingesting Twitter data with the twitter input and then running ruby inline code to put links in a separate field. Unfortunately, twitter links appears to be case sensitive and my ruby code isn't preserving case. Any ideas?

```
  if [extended_tweet][full_text] {
    ruby {
      code => "event.set('links', event.get('[extended_tweet][full_text]').scan(/https?:\/\/\S*/i))"
    }
  } else {
    ruby {
      code => "event.set('links', event.get('text').scan(/https?:\/\/\S*/i))"
    }
  }

```

Output in Kibana:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2fb9c6475927ca9f6c5d9447e3c3aeae7592368f.png)

---

<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:** [April 25, 2018, 4:22am UTC](https://discuss.elastic.co/t/ruby-filter-preserving-case/125847/2 "2018-04-25T04:22:56Z")

</div>

Closed on April 25, 2018, 4:22am UTC

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