Hi
I've created a logstash input filter:
filter {
jdbc_static {
loaders => [
{
id => "remote-ipsservers"
query => "select address, display_name from host_list'"
local_table => "host_list"
}
]
local_db_objects => [
{
name => "host_list"
index_columns => ["address"]
columns => [
["address", "varchar(255)"],
["display_name", "varchar(255)"]
]
}
]
local_lookups => [
{
id => "local-ipsservers"
query => "select display_name as description from host_list WHERE address = :ip"
parameters => {ip => "[host][ip]"}
target => "probes"
}
]
# reload database every our
loader_schedule => "00 * * * *"
jdbc_user => "logstash"
jdbc_password => "12345678"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_driver_library => "/extras/mysql-connector-java-5.1.46.jar"
jdbc_connection_string => "jdbc:mysql://10.33.33.10:3306/inventory?useSSL=false"
}
# If found, add name
if [probes][0][description] {
mutate {
# using add_field here to add & rename values to the event root
add_field => { nombre_sonda => "%{[probes][0][description]}" }
}
}
# If not, write a default name
else {
mutate {
add_field => { nombre_sonda => "unknown" }
}
}
# we use probes just temporarily and we don't need it here anymore
mutate {
remove_field => ["probes"]
}
}
I'm receiving netflow packets, and then I do a lookup of the host.ip parameter in netflow to a remote mysql database to query for the name for that ip. The filter works perfect, but if I start logstash and the mysql server is down, or fails authentication, logstash just shut down with the following logs:
[ERROR][logstash.agent ] Failed to execute action {:id=>:flows, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Could not execute action: PipelineAction::Create<flows>, action_result: false", :backtrace=>nil}
[INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[INFO ][logstash.runner ] Logstash shut down.
Is there any logstash parameter to disable shutdown when the jdbc driver fails connection? As I said, that's not a syntax error, it fails only when the remote mysql is unavailable
Thanks
Cheers