# Importing MSSQL data to Elasticsearch 5.0.0 via Logstash 5.0.0

**URL:** <https://discuss.elastic.co/t/importing-mssql-data-to-elasticsearch-5-0-0-via-logstash-5-0-0/67690>\
**Category:** Logstash\
**Created:** [December 1, 2016, 12:26am UTC](https://discuss.elastic.co/t/importing-mssql-data-to-elasticsearch-5-0-0-via-logstash-5-0-0/67690 "2016-12-01T00:26:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lakinen](https://avatars.discourse-cdn.com/v4/letter/l/ea5d25/32.png) [@lakinen](https://discuss.elastic.co/u/lakinen)\
**Post date:** [December 1, 2016, 12:26am UTC](https://discuss.elastic.co/t/importing-mssql-data-to-elasticsearch-5-0-0-via-logstash-5-0-0/67690/1 "2016-12-01T00:26:48Z")

</div>

Hi,

I'm trying to import basic data from MSSQL table with 2 columns.  
Using logstash-input-jdbc built-in pluging I have managed to connect to database and run the simple SELECT query to fetch all data from the table.

But if I want to put that data to output using logstash, all the time I'm getting only header information in Elasticsearch 5.

I have tried many output options but non of them give me result, so I can see all result rows places to the Elasticseach index.

I have tried to run conf file where output part is like this:  
output {  
elasticsearch {  
action =\> "index"  
index =\> "testdb"  
}  
stdout { codec =\> json\_lines }  
}

When I try to reach index tempdb via Kibana Dev Tools with GET /testdb my results are like this:  
{  
"testdb": {  
"aliases": {},  
"mappings": {  
"logs": {  
"properties": {  
"@timestamp": {  
"type": "date"  
},  
"@version": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"id\_status": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"status\_name": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
}  
}  
}  
},  
"settings": {  
"index": {  
"creation\_date": "1480551071623",  
"number\_of\_shards": "5",  
"number\_of\_replicas": "1",  
"uuid": "1TkCev0STdKbYCqgZ6tdzA",  
"version": {  
"created": "5000099"  
},  
"provided\_name": "testdb"  
}  
}

Json output is showing something what I actually need stored inside of elasticsearch:  
[2016-12-01T01:11:11,604][INFO][logstash.agent] Successfully started  
Logstash API endpoint {:port=\>9600}  
**_{"id\_status":"0001","@timestamp":"2016-12-01T00:11:10.768Z","status\_name":"CardError","@version":"1"}_**  
**\_ {"id\_status":"0002","@timestamp":"2016-12-01T00:11:11.312Z","status\_name":"CardDbError","@version":"1"}\_**  
**\_ {"id\_status":"0003","@timestamp":"2016-12-01T00:11:11.318Z","status\_name":"CardOk","@version":"1"}\_**

What is the right way to store all output values to the ElasticSearch 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:** [December 29, 2016, 12:26am UTC](https://discuss.elastic.co/t/importing-mssql-data-to-elasticsearch-5-0-0-via-logstash-5-0-0/67690/2 "2016-12-29T00:26:52Z")

</div>

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