# Create a view mysql with logstash

**URL:** <https://discuss.elastic.co/t/create-a-view-mysql-with-logstash/262223>\
**Category:** Logstash\
**Created:** [January 26, 2021, 11:01am UTC](https://discuss.elastic.co/t/create-a-view-mysql-with-logstash/262223 "2021-01-26T11:01:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MatteoM](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@MatteoM](https://discuss.elastic.co/u/MatteoM)\
**Post date:** [January 26, 2021, 11:01am UTC](https://discuss.elastic.co/t/create-a-view-mysql-with-logstash/262223/1 "2021-01-26T11:01:02Z")

</div>

Hi there!,  
I was wondering if exists a way to create a view mysql through by the statement in the pipeline input jdbc.  
I need to create some views because these are involved in a query that I need it to save in a index in elasticsearch.

PS: one last thing if I have more then one mysql tables how can i make more one index for table ?  
Let me be clear, I have 3 tables: tableA, tableB, tableC and I want to save these in elasticsearch like tableA-index, tableB-index, tableC-index.  
if I understand correctly I have to create a pipeline output like this, right?  
output {

```
  stdout { codec => json_lines }
  elasticsearch {
    hosts => "elasticsearch:9200"
    index => "tableA-index"
  }

  stdout { codec => json_lines }
  elasticsearch {
    hosts => "elasticsearch:9200"
    index => "tableB-index"
  }

  stdout { codec => json_lines }
  elasticsearch {
    hosts => "elasticsearch:9200"
    index => "tableC-index"
  }
}
```

---

<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:** [February 23, 2021, 11:01am UTC](https://discuss.elastic.co/t/create-a-view-mysql-with-logstash/262223/2 "2021-02-23T11:01:11Z")

</div>

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