0

Oracle DB: 11.2.0.4 OJDBC version: ojdbc6.jar JDK: openjdk 1.8 LogStash version: 6.3.2-1 I am recieving following error in logstash error log [ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::JavaSql::SQLException: ORA-00604: erro occurred at recursive SQL level 1\nORA-01882: timezone region not found\n"} Logstash code:

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" => "&#x2757; Current Session Count  &#x1F631;"
                           }
        }
}
Ysumit
  • 1
  • 1
  • 1

1 Answers1

0

Had the same problem, solved it adding a line in the logstash jvm.options

-Duser.timezone="+01:00"  

of course you have to change the +01 with your timezone

Barry
  • 3,303
  • 7
  • 23
  • 42