title: How to define mapping in logstash for SQL attributes
body: <p>I use logstash to index data from a database (in this case Postgres) and put it in an Elasticsearch index. This is my config:</p>
  
  <pre><code>input {
  
      jdbc {
          jdbc_driver_library =&gt; "/path/to/driver"
          jdbc_driver_class =&gt; "org.postgresql.Driver"
          jdbc_connection_string =&gt; "jdbc:postgresql://POSTGRE_HOST:5432/db"
          jdbc_user =&gt; "postgres"
          jdbc_password =&gt; "top-secret"
          statement =&gt; "SELECT id, title, description, username FROM products"
          add_field =&gt; [ "type", "product" ]
      }
  }
  
  output {
      if [type] == "product" {
          elasticsearch {
              action =&gt; "index"
              hosts =&gt; "localhost:9200"
              index =&gt; "products"
              document_id =&gt; "%{id}"
              document_type =&gt; "%{type}"
              workers =&gt; 1
          }
      }
  }
  </code></pre>
  
  <p>Question: How can I define a mapping for my SQL query, so that e.g. title + description are indexed as text, but user is indexed as keyword data type?</p>