# Parsing error Logstash with file as input

**URL:** https://discuss.elastic.co/t/parsing-error-logstash-with-file-as-input/256227
**Category:** Logstash
**Created:** [November 21, 2020, 2:48pm UTC](https://discuss.elastic.co/t/parsing-error-logstash-with-file-as-input/256227 "2020-11-21T14:48:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Xor44](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xor44/32/55721_2.png) [@Xor44](https://discuss.elastic.co/u/Xor44)
#### Post date: [November 21, 2020, 2:48pm UTC](https://discuss.elastic.co/t/parsing-error-logstash-with-file-as-input/256227/1 "2020-11-21T14:48:09Z")

</div>

Hi Folks ,  
I'm new in ELK , i'm trying read and parse a file with logstash. But I get some errors during the parsing process  
Here is an example of logs

// date="Nov 21 2020 14:36:00" AED="1.1.1.1" type=group\_location pg\_id="3000" pg\_name="TEST on ASP-LAB1" country="US" bpsPassed="18" bpsDropped="0" ppsPassed="0" ppsDropped="0"  
date="Nov 21 2020 14:37:00" AED="1.1.1.1" type=group\_location pg\_id="3000" pg\_name="TEST on ASP-LAB1" country="US" bpsPassed="36" bpsDropped="0" ppsPassed="0" ppsDropped="0"

//  
input {  
file{  
path =\> "/home/data/aed\_ts-\*"  
start\_position =\> "beginning"  
sincedb\_path =\> "NUL"  
codec =\> json }  
}  
filter {  
json {  
source =\> "message"  
}  
}  
output {  
elasticsearch {  
index =\> "ed-test-1%{+YYYY.MM.dd}"  
hosts =\> ["[https://es01:9200](https://es01:9200/)"]  
ssl =\> true  
ssl\_certificate\_verification =\> false  
cacert =\> "/usr/share/logstash/certs/ca/ca.crt"  
manage\_template =\> false  
user =\> "elastic"  
password =\> "${ELASTIC\_PASSWORD}"  
}  
}  
//

---

<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: [November 21, 2020, 3:09pm UTC](https://discuss.elastic.co/t/parsing-error-logstash-with-file-as-input/256227/2 "2020-11-21T15:09:30Z")

</div>

Those logs are not JSON, so both the json codec and the json filter will produce errors. Remove the json codec and replace the json filter with a [kv](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html) filter.

---

<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 19, 2020, 3:09pm UTC](https://discuss.elastic.co/t/parsing-error-logstash-with-file-as-input/256227/3 "2020-12-19T15:09:40Z")

</div>

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