# Reading json file through logstash

**URL:** https://discuss.elastic.co/t/reading-json-file-through-logstash/59995
**Category:** Logstash
**Created:** [September 7, 2016, 2:26pm UTC](https://discuss.elastic.co/t/reading-json-file-through-logstash/59995 "2016-09-07T14:26:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![saisn](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@saisn](https://discuss.elastic.co/u/saisn)
#### Post date: [September 7, 2016, 2:26pm UTC](https://discuss.elastic.co/t/reading-json-file-through-logstash/59995/1 "2016-09-07T14:26:39Z")

</div>

I have a json in the below format

abc def{"DeviceId": "00D0","From": "LA","NotificationType": "Message","PublishTime": "2016-08-12T16:00:01.0995115+00:00",{"Version": "1.0","DeviceId": "00D0","From": "00D0"}

how can i ignore the abc def before the json and the above json is in single line. Can logstash parse something in the above format?

Thanks in advance

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [September 9, 2016, 7:20am UTC](https://discuss.elastic.co/t/reading-json-file-through-logstash/59995/2 "2016-09-09T07:20:52Z")

</div>

Either

- use a grok filter to extract "abc def" to one or more fields and the JSON payload to another field and feed the latter to the json filter, or
- if you just want to delete "abc def" use a mutate filter and its gsub option to remove it (and feed the resulting string to the json filter).

---

<div class="post-metadata">

### Author: ![saisn](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@saisn](https://discuss.elastic.co/u/saisn)
#### Post date: [September 22, 2016, 2:23pm UTC](https://discuss.elastic.co/t/reading-json-file-through-logstash/59995/3 "2016-09-22T14:23:45Z")

</div>

Thanks for the reply. Here, I am using a python code to resolve this

---

<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 6, 2017, 4:37am UTC](https://discuss.elastic.co/t/reading-json-file-through-logstash/59995/4 "2017-07-06T04:37:18Z")

</div>


