# Help with JSON output format

**URL:** <https://discuss.elastic.co/t/help-with-json-output-format/89839>\
**Category:** Logstash\
**Created:** [June 18, 2017, 8:37am UTC](https://discuss.elastic.co/t/help-with-json-output-format/89839 "2017-06-18T08:37:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aganatra13](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@aganatra13](https://discuss.elastic.co/u/aganatra13)\
**Post date:** [June 18, 2017, 8:37am UTC](https://discuss.elastic.co/t/help-with-json-output-format/89839/1 "2017-06-18T08:37:21Z")

</div>

Can someone help me with writing correct configuration file such that JSON output

1. Does not contain metadata like source file name, time stamp, host name etc..
2. Each column in input does not become a JSON document

Listed below is a line from input file and 2 rows from output file.

Input file format:  
1|Toy Story (1995)|01-Jan-1995||http://us.imdb.com/M/title-exact?Toy%20Story%20(1995)|0|0|0|1|1|1|0|0|0|0|0|0|0|0|0|0|0|0

Current JSON output:  
{"path":"C:\ml-100k\ml-100k\u.item","@timestamp":"2017-06-18T10:08:49.210Z","@version":"1","host":"WIN-KALHJUSVJJU","message":"1"}{"path":"C:\ml-100k\ml-100k\u.item","@timestamp":"2017-06-18T10:08:49.225Z","@version":"1","host":"WIN-KALHJUSVJJU","message":"Toy Story (1995)"}

Thank you,  
Amit

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 18, 2017, 9:09am UTC](https://discuss.elastic.co/t/help-with-json-output-format/89839/2 "2017-06-18T09:09:46Z")

</div>

1 - You can use `remove_field` for some of this.  
2 - Depends on what your config looks like now.

If you are having issues then posting the specifics would be good.

---

<div class="post-metadata">

**Author:** ![aganatra13](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@aganatra13](https://discuss.elastic.co/u/aganatra13)\
**Post date:** [June 18, 2017, 7:14pm UTC](https://discuss.elastic.co/t/help-with-json-output-format/89839/3 "2017-06-18T19:14:45Z")

</div>

Listed is the config file. Any pointers or examples on how to implement the remove\_fields ?

input{  
file {  
path =\> "C:\ml-100k\ml-100k\u.item"   
start\_position =\> ["beginning"]  
delimiter =\> "|"  
sincedb\_path =\> "nul"  
}  
}

filter {  
}

output {  
file {  
codec =\> json  
path =\> "C:\items.json"  
}

}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 18, 2017, 11:59pm UTC](https://discuss.elastic.co/t/help-with-json-output-format/89839/4 "2017-06-18T23:59:14Z")

</div>

You should really use something like the csv filter to properly structure the event.

That has remove field too. [https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html)

---

<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 16, 2017, 11:59pm UTC](https://discuss.elastic.co/t/help-with-json-output-format/89839/5 "2017-07-16T23:59:36Z")

</div>

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