# Logstash 7.1.1 - Any quote symbol except ' and " for ruby code?

**URL:** <https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527>\
**Category:** Logstash\
**Created:** [June 19, 2019, 6:22pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527 "2019-06-19T18:22:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexl](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@Alexl](https://discuss.elastic.co/u/Alexl)\
**Post date:** [June 19, 2019, 6:22pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527/1 "2019-06-19T18:22:21Z")

</div>

Hello all!  
I'm trying to pass obtained by grok variable data into ruby code filter and I need to do that in double quotas of plain ruby code which contain 'somestring' that I would like to concatenate with my variable. So, there are several issues like grok to ruby data transmit and concatenation. I haven't found a solution over the internet using ruby code filter without external script. Please, help.  
Thank you for your assistance!

---

<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 19, 2019, 6:54pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527/2 "2019-06-19T18:54:19Z")

</div>

Can you describe this a little more? I normally use single quotes for the code option on the ruby filter so that I can use double quotes (and string interpolation) in the code block.

Ignoring the grok, what do you want to do with which fields in the ruby code?

---

<div class="post-metadata">

**Author:** ![Alexl](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@Alexl](https://discuss.elastic.co/u/Alexl)\
**Post date:** [June 19, 2019, 8:14pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527/3 "2019-06-19T20:14:09Z")

</div>

I'm filling the ruby Net::HTTP post(uri, data, headers) like this in filter:  
ruby {  
code =\> "  
...  
data = '{'key':'valuefrommessage'}'  
…  
"  
}

If I'm writing something like #{[groked]} instead of valuefrommessage then logstash print it as is without value replacement.

---

<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 19, 2019, 10:35pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527/4 "2019-06-19T22:35:33Z")

</div>

Right, because string interpolation only happens inside of double quoted strings. I think you will have to concatenate different parts of the string instead of using interpolation.

---

<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 17, 2019, 10:35pm UTC](https://discuss.elastic.co/t/logstash-7-1-1-any-quote-symbol-except-and-for-ruby-code/186527/5 "2019-07-17T22:35:44Z")

</div>

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