# Logstash JDBC analyzers

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-analyzers/231210>\
**Category:** Logstash\
**Created:** [May 5, 2020, 7:07pm UTC](https://discuss.elastic.co/t/logstash-jdbc-analyzers/231210 "2020-05-05T19:07:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Juliano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_juliano/32/48845_2.png) [@Kevin\_Juliano](https://discuss.elastic.co/u/Kevin_Juliano)\
**Post date:** [May 5, 2020, 7:07pm UTC](https://discuss.elastic.co/t/logstash-jdbc-analyzers/231210/1 "2020-05-05T19:07:06Z")

</div>

Hi Everyone, I'm still new to Elastic. I am trying to use the `snowball` or `porter_strem` analyzer but I have no Idea how to do it with JDBC Logstash and PostgreSQL, as far as I search and looked for solution,to use this feature, I need to create a custom analyzer and and map the fields then set the custom analyzer for the field that needed the analyzer.

So my question is: how can I do custom mapping on Logstash JDBC indexing? because right now, when I run an index, It will automatically create its own mapping.

Here's my Logstash config example:

```
input {
    jdbc {
        jdbc_connection_string => "jdbc:postgresql://localhost/testindex?user=[MYUSER]&password=[MYPASS]"
        jdbc_user => "postgres"
        jdbc_driver_library => ""
        jdbc_driver_class => "org.postgresql.Driver"
        schedule => "* * * * *"
        use_column_value => true
		tracking_column => pid
        statement => "SELECT pid, title FROM products"
        clean_run => true
    }
}

filter {
	jdbc_streaming {
	    jdbc_connection_string => "jdbc:postgresql://localhost/testindex?user=[MYUSER]&password=[MYPASS]"
	    jdbc_user => "postgres"
	    jdbc_driver_class => "org.postgresql.Driver"
	    statement => "SELECT text from classes WHERE pid=:pid "
	    parameters => {"pid" => "[pid]"}
	    target => "[classes]"
  }
}

output {
    elasticsearch {
        index => "testindex"
        hosts => "http://localhost:9200"
        document_id => "%{pid}"
    }
}

```

Please tell me if I am doing it wrong  
any help will be appreciated.

---

<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:** [June 2, 2020, 7:07pm UTC](https://discuss.elastic.co/t/logstash-jdbc-analyzers/231210/2 "2020-06-02T19:07:10Z")

</div>

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