Oracle DB:11.2.0.4 OJDBC 版本:ojdbc6.jar JDK:openjdk 1.8 LogStash 版本:6.3.2-1 我在 logstash 错误日志 [ERROR] [logstash.inputs.jdbc] 中收到以下错误无法连接到数据库。尝试了 1 次 {:error_message=>"Java::JavaSql::SQLException: ORA-00604: 错误发生在递归 SQL 级别 1\nORA-01882: timezone region not found\n"} Logstash 代码:
input{
jdbc{
# jdbc_default_timezone => "Asia/Kolkata"
jdbc_driver_library => "/var/lib/logstash/OJDBC-Full/ojdbc6.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@xxxx:port:sid"
jdbc_user => "xxxx"
jdbc_password => "xxxx"
jdbc_validate_connection => true
statement => "select count(*) from apps.icx_sessions icx join apps.fnd_user usr on usr.user_id=icx.user_id left join apps.fnd_responsibility resp on resp.responsibility_id=icx.responsibility_id where last_connect>sysdate-nvl(FND_PROFILE.VALUE('ICX_SESSION_TIMEOUT'),30)/60/24 and disabled_flag != 'Y' and pseudo_flag = 'N' and USER_NAME <> 'GUEST'"
type => "xxx_RPT_DB_Session_query"
schedule => "*/2 * * * *"
}
}
filter{
}
output{
file{
path => "/var/log/logstash/sample-JDBC-%{+YYYY-MM-dd}.txt"
}
elasticsearch{
hosts => ["xxxxxxxxx:7778"]
index => "q_session"
}
http{
format => "json"
http_method => "post"
url => "https://api.telegram.org/bot629711229:AAFDebywi4NDiSdqqHhmxTFlUH7cMUJwwvE/sendMessage"
mapping => {
"chat_id" => "xxxxx"
"parse_mode" => "html"
"text" => "❗ Current Session Count 😱"
}
}
}