# Import JSON String data as a Flat table

**URL:** <https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557>\
**Category:** Logstash\
**Created:** [June 19, 2019, 10:46pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557 "2019-06-19T22:46:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sxmalla](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sxmalla](https://discuss.elastic.co/u/sxmalla)\
**Post date:** [June 19, 2019, 10:46pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557/1 "2019-06-19T22:46:57Z")

</div>

Hi  
I imported Data from SQL server into elastic using Logstash jdbc plugin. The data contains a Varchar(4000) element which contains Json string in it. Is there any way that I can take that data in JSON format and parse it as individual elements into an index using Logstash

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 19, 2019, 11:57pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557/2 "2019-06-19T23:57:09Z")

</div>

I suggest a [json](https://www.elastic.co/guide/en/logstash/current/plugins-filters-json.html) filter.

If that does not work then please show us a reproducible example of data that gets a \_jsonparsefailure (with element names and values sanitized as necessary).

---

<div class="post-metadata">

**Author:** ![sxmalla](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sxmalla](https://discuss.elastic.co/u/sxmalla)\
**Post date:** [June 20, 2019, 12:02pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557/3 "2019-06-20T12:02:29Z")

</div>

So I did try a json filter and below is my conf file

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6d773f4a08612ba106edb2b9c9f1f253732ef5f8.png)  
There were no errors when I ran the logstash conf . But when I see the index created I see that the target field was not created . WHat am I missing

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 20, 2019, 12:04pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557/4 "2019-06-20T12:04:49Z")

</div>

What does an event look like on stdout?

---

<div class="post-metadata">

**Author:** ![sxmalla](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@sxmalla](https://discuss.elastic.co/u/sxmalla)\
**Post date:** [June 20, 2019, 12:18pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557/5 "2019-06-20T12:18:24Z")

</div>

Don't see much it just prints the json strings from the table and in the end  
[INFO] 2019-06-19 22:27:05.584 [[main]-pipeline-manager] pipeline - Pipeline has terminated {:pipeline\_id=\>"main", :thread=\>"#\<Thread:0x4a43b827 run\>"}

---

<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:** [July 18, 2019, 12:18pm UTC](https://discuss.elastic.co/t/import-json-string-data-as-a-flat-table/186557/6 "2019-07-18T12:18:26Z")

</div>

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