# How to make this json array as csv data

**URL:** https://discuss.elastic.co/t/how-to-make-this-json-array-as-csv-data/226775
**Category:** Logstash
**Created:** [April 6, 2020, 8:36pm UTC](https://discuss.elastic.co/t/how-to-make-this-json-array-as-csv-data/226775 "2020-04-06T20:36:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [April 6, 2020, 8:36pm UTC](https://discuss.elastic.co/t/how-to-make-this-json-array-as-csv-data/226775/1 "2020-04-06T20:36:20Z")

</div>

Hi All

I have json data like this

```
[{
		"jsondata": ["123456", "description1", "notes1", "information1", 9]
	}, {
		"jsondata": ["44555", "description2", "notes2", "information2", 8]
	}
]

```

I need the output in csv format like this

```
123456,description1,notes1,information1,9
44555,description2,notes2,information2,8

```

I have tried this in filters

> split{field =\> "message"}  
> mutate{gsub =\> ["jsondata", "[]",""]  
> csv{  
> source =\> "jsondata"  
> columns =\> ["header1", "header2","header3", "header4","header5"]  
> separator =\> ","  
> }

Please let me know how to solve this

Thanks

---

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [April 7, 2020, 3:42am UTC](https://discuss.elastic.co/t/how-to-make-this-json-array-as-csv-data/226775/2 "2020-04-07T03:42:45Z")

</div>

Fixed it by my own. By adding rename to the array.

---

<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: [May 5, 2020, 3:42am UTC](https://discuss.elastic.co/t/how-to-make-this-json-array-as-csv-data/226775/3 "2020-05-05T03:42:48Z")

</div>

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