# Strict schema when using CSV plugin

**URL:** <https://discuss.elastic.co/t/strict-schema-when-using-csv-plugin/103358>\
**Category:** Logstash\
**Created:** [October 10, 2017, 11:41am UTC](https://discuss.elastic.co/t/strict-schema-when-using-csv-plugin/103358 "2017-10-10T11:41:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Israel\_Elmekies](https://avatars.discourse-cdn.com/v4/letter/i/2bfe46/32.png) [@Israel\_Elmekies](https://discuss.elastic.co/u/Israel_Elmekies)\
**Post date:** [October 10, 2017, 11:41am UTC](https://discuss.elastic.co/t/strict-schema-when-using-csv-plugin/103358/1 "2017-10-10T11:41:47Z")

</div>

Hi All,

I'm relatively new to Logstash.  
I'm using the CSV filter plugin to read a csv log. I wanted to add the option that if the line that is being read  
does not have the same schema as defined, then an error will be written to a log file.

The things is, any schema is good for the plugin. The only thing causing a \_csvparsefailure is an empty line.  
For example, if my schema is  
`columns => ["a", "b"]`  
and my input is "hello,world,bla" I will not get a \_csvparsefailure.  
Is there any way to work with a 'strict' schema? Meaning any message that is does not produce that exact amount of column as specified should be considered a parsing failure.

Thanks for any help!

---

<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:** [November 7, 2017, 11:41am UTC](https://discuss.elastic.co/t/strict-schema-when-using-csv-plugin/103358/2 "2017-11-07T11:41:51Z")

</div>

Closed on November 7, 2017, 11:41am UTC

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