# Is this json format correct for upload to logstash/elasicsearch

**URL:** <https://discuss.elastic.co/t/is-this-json-format-correct-for-upload-to-logstash-elasicsearch/157194>\
**Category:** Logstash\
**Created:** [November 17, 2018, 9:40pm UTC](https://discuss.elastic.co/t/is-this-json-format-correct-for-upload-to-logstash-elasicsearch/157194 "2018-11-17T21:40:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gittinfunky](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@gittinfunky](https://discuss.elastic.co/u/gittinfunky)\
**Post date:** [November 17, 2018, 9:40pm UTC](https://discuss.elastic.co/t/is-this-json-format-correct-for-upload-to-logstash-elasicsearch/157194/1 "2018-11-17T21:40:48Z")

</div>

I have a series of json files created using tshark (see example below) which I would like to visualise eith ELK. Is the current json format ok for upload to logstash or do I need to parse it in some other format

`[{"No.": "1", "Time": "0", "Source": "192.168.252.40", "Destination": "112.156.122.25", "Protocol": "TCP", "Length": "64", "Info": "9145 > 2323 [SYN] Seq=0 Win=12713 Len=0 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]", "label": "normal"},{"No.": "2", "Time": "0.000615", "Source": "192.168.252.40", "Destination": "115.36.214.222", "Protocol": "TCP", "Length": "64", "Info": "9145 > 23 [SYN] Seq=0 Win=12713 Len=0 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]", "label": "normal"}]`

---

<div class="post-metadata">

**Author:** ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)\
**Post date:** [November 17, 2018, 10:30pm UTC](https://discuss.elastic.co/t/is-this-json-format-correct-for-upload-to-logstash-elasicsearch/157194/2 "2018-11-17T22:30:02Z")

</div>

I'm not sure if the json filter will parse it out since it is contained in `[]` but you could always use the mutate function with gsub and regex to remove them prior to the json filter.

---

<div class="post-metadata">

**Author:** ![gittinfunky](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@gittinfunky](https://discuss.elastic.co/u/gittinfunky)\
**Post date:** [November 18, 2018, 7:40am UTC](https://discuss.elastic.co/t/is-this-json-format-correct-for-upload-to-logstash-elasicsearch/157194/3 "2018-11-18T07:40:24Z")

</div>

thanks @wwalker

would it easier if the json file was just a series of one line dictionary key value pairs like below, although when I check this isnt a valid json format

```
{"No.": "No.", "Time": "Time", "Source": "Source", "Destination": "Destination", "Protocol": "Protocol", "Length": "Length", "Info": "Info", "label": "label"}
{"No.": "1", "Time": "0", "Source": "192.168.252.40", "Destination": "112.156.122.25", "Protocol": "TCP", "Length": "64", "Info": "9145 > 2323 [SYN] Seq=0 Win=12713 Len=0 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]", "label": "normal"}
{"No.": "2", "Time": "0.000615", "Source": "192.168.252.40", "Destination": "115.36.214.222", "Protocol": "TCP", "Length": "64", "Info": "9145 > 23 [SYN] Seq=0 Win=12713 Len=0 [ETHERNET FRAME CHECK SEQUENCE INCORRECT]", "label": "normal"}
```

---

<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 16, 2018, 7:49am UTC](https://discuss.elastic.co/t/is-this-json-format-correct-for-upload-to-logstash-elasicsearch/157194/4 "2018-12-16T07:49:44Z")

</div>

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