# Validation in logstash input section

**URL:** <https://discuss.elastic.co/t/validation-in-logstash-input-section/81815>\
**Category:** Logstash\
**Created:** [April 10, 2017, 12:22pm UTC](https://discuss.elastic.co/t/validation-in-logstash-input-section/81815 "2017-04-10T12:22:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiranilla](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@kiranilla](https://discuss.elastic.co/u/kiranilla)\
**Post date:** [April 10, 2017, 12:22pm UTC](https://discuss.elastic.co/t/validation-in-logstash-input-section/81815/1 "2017-04-10T12:22:50Z")

</div>

I have tried by running the following script in the input section providing a wrong input file path  
but it did not show any error message after running the script:

```
input {

file {
    path => "C:\DataSet\EXP_DATA.csv"
    start_position => beginning
		sincedb_path=>"dev/null"
}
}
filter {
....
}

output {
 
....
}

```

 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/e/ee483c97e7507648675162caf1dd1836314624a1.JPG)

` I have tried giving the ruby script in input section as shown below:

```
input {
    ruby {
	
		file {
		 
			code => '
			begin
				path => "C:\DataSet\EXP_DATA.csv"
				start_position => beginning
				sincedb_path=>"dev/null"
			rescue => e
						event.set("Error_Msg",e.to_s())
					else
						event.set("Error_Msg","no Error")
					end	
				
			'
		}
    }
}

filter {
....
}

output {
....
}

```

it gave me the following error :

 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/8/982e83ba14657aee04aa8db349e6f6b4324594ba.JPG)

It looks like there is no ruby plugin available for input section,  
could you please help me out in getting the error message and handling it in 'input' section of logstash.  
Is there any way that we can handle validations in 'input' section of logstash.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 11, 2017, 7:00pm UTC](https://discuss.elastic.co/t/validation-in-logstash-input-section/81815/2 "2017-04-11T19:00:17Z")

</div>

Why do you have to do it at the input instead of the filter?

---

<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:** [April 12, 2017, 5:27am UTC](https://discuss.elastic.co/t/validation-in-logstash-input-section/81815/3 "2017-04-12T05:27:47Z")

</div>

To disable sincedb use "nul" on Windows and "/dev/null" on all other platforms. "dev/null" is always wrong.

---

<div class="post-metadata">

**Author:** ![kiranilla](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@kiranilla](https://discuss.elastic.co/u/kiranilla)\
**Post date:** [April 14, 2017, 9:36am UTC](https://discuss.elastic.co/t/validation-in-logstash-input-section/81815/4 "2017-04-14T09:36:26Z")

</div>

Thanks Magnus, i will correct it.

---

<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:** [May 12, 2017, 9:50am UTC](https://discuss.elastic.co/t/validation-in-logstash-input-section/81815/5 "2017-05-12T09:50:24Z")

</div>

Closed on May 12, 2017, 9:50am UTC

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