# Logstash JDBC query for LIKE operator

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-query-for-like-operator/200949>\
**Category:** Logstash\
**Created:** [September 25, 2019, 3:04am UTC](https://discuss.elastic.co/t/logstash-jdbc-query-for-like-operator/200949 "2019-09-25T03:04:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donny\_Nightfrost](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/donny_nightfrost/32/43536_2.png) [@Donny\_Nightfrost](https://discuss.elastic.co/u/Donny_Nightfrost)\
**Post date:** [September 25, 2019, 3:04am UTC](https://discuss.elastic.co/t/logstash-jdbc-query-for-like-operator/200949/1 "2019-09-25T03:04:40Z")

</div>

Hi guys, I have a jdbc static query like this:

```
local_lookups => [
      {
        query => "select * from servers WHERE ip LIKE = '%:ip%'"
        parameters => {ip => "[from_ip]"}
        target => "server"
      }
    ]
```

I want to search based from field "from\_ip" with LIKE operator on my database. Problem is, LIKE operator followed by '%:ip%' can't be run. How to properly use the LIKE operator on jdbc query?

---

<div class="post-metadata">

**Author:** ![Donny\_Nightfrost](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/donny_nightfrost/32/43536_2.png) [@Donny\_Nightfrost](https://discuss.elastic.co/u/Donny_Nightfrost)\
**Post date:** [September 26, 2019, 2:49am UTC](https://discuss.elastic.co/t/logstash-jdbc-query-for-like-operator/200949/2 "2019-09-26T02:49:13Z")

</div>

Anyone?

---

<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:** [October 24, 2019, 2:49am UTC](https://discuss.elastic.co/t/logstash-jdbc-query-for-like-operator/200949/3 "2019-10-24T02:49:13Z")

</div>

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