Validation in logstash input section

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 {
 
....
}

` 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 :

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.

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

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

Thanks Magnus, i will correct it.

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