# Logstash adds too many fields / avoid fields from other tables

**URL:** <https://discuss.elastic.co/t/logstash-adds-too-many-fields-avoid-fields-from-other-tables/249802>\
**Category:** Logstash\
**Created:** [September 24, 2020, 11:38am UTC](https://discuss.elastic.co/t/logstash-adds-too-many-fields-avoid-fields-from-other-tables/249802 "2020-09-24T11:38:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![llama0815](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@llama0815](https://discuss.elastic.co/u/llama0815)\
**Post date:** [September 24, 2020, 11:38am UTC](https://discuss.elastic.co/t/logstash-adds-too-many-fields-avoid-fields-from-other-tables/249802/1 "2020-09-24T11:38:32Z")

</div>

Hey guys,

I'm using logstash and jdbc to import few tables. But all tables are running to the field limit (\>1000).  
I tried to import several other tables with several hundred columns (still each \<1000) but but they add up together.

the following table has only 7 columns and no foreign keys.

```auto
     logstash_sample.conf: |
        # all input will come from filebeat, no local logs
        input {
          jdbc {
            jdbc_connection_string => "jdbc:mysql://URL"
            jdbc_user => "USER"
            jdbc_password => "PW"
            jdbc_driver_library => "/usr/share/mysql-connector-java-8.0.21.jar"
            jdbc_driver_class => "com.mysql.jdbc.Driver"
            schedule => "*/20 * * * *"
            statement => "SELECT * FROM 7columns"
           }
         }
        output {
          elasticsearch {
            hosts => ["elasticsearch-client:9200"]
            index => "sample"
          }
        }

```

Running this somehow results in an index with \>1000 fields.  
Every .conf has its own output index.

What's the schema behind?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jfs1](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jfs1](https://discuss.elastic.co/u/jfs1)\
**Post date:** [September 24, 2020, 11:46am UTC](https://discuss.elastic.co/t/logstash-adds-too-many-fields-avoid-fields-from-other-tables/249802/2 "2020-09-24T11:46:08Z")

</div>

Start by debugging logstash output by replacing the elasticsearch output plugin with stdout.  
Most probably, your "SELECT \*" results in more than 7 columns.  
Depending on the output, you may want to add a mutate{} filter to get rid of unwanted columns.

---

<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 22, 2020, 11:46am UTC](https://discuss.elastic.co/t/logstash-adds-too-many-fields-avoid-fields-from-other-tables/249802/3 "2020-10-22T11:46:17Z")

</div>

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