I tried to update the timezone still giving me errors. Now I suspect its something wrong with the format. I tried to include a timezone and match it with the date but it did not catch on. So then I tried to catch it with a grok statement but its giving me an error even though I tested the pattern and its a 99% match:
input {
jdbc {
jdbc_driver_library => "logstash-1.5.0/ojdbc6.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
jdbc_connection_string => "jdbc:oracle:thin:@//"
jdbc_user => ""
jdbc_password => ""
statement => "SELECT to_char(creation_time,'YYYY-MM-dd HH24:MI:SSxFF TZR') as logStoreTime from logwhere creation_time > :sql_last_start"
record_last_run => true
last_run_metadata_path => "/.logstash_jdbc_last_run"
type => "log"
}
}
filter {
grok {
match => {"logStoreTime" => "(?<logStoreTime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.\d{6} \+\d{2}:\d{2})"}
}
# date {
# locale => "en"
# timezone => "GMT"
# match => [
# "logStoreTime" , "YYYY-MM-dd HH:mm:ss.SSSSSS Z"
# ]
# }
}
I commented out the date part after I tried to move around the date format like MM-YYYY-dd even when I did not change the select format and no errors occurred. So I think now it has to be something with the data type because grok is not matching. Here is some more infor
Name Null? Type
----------------------------------------- -------- ----------------------------
CREATION_TIME NOT NULL TIMESTAMP(6)
my output from this filter currently config (not date matching):
{
"logstoretime" => "2015-08-04 18:34:14.747000 +00:00",
"@version" => "1",
"@timestamp" => "2015-08-06T12:52:15.850Z",
"type" => "test",
"tags" => [
[0] "_grokparsefailure"
]
}
{
"logstoretime" => "2015-08-04 18:34:18.661000 +00:00",
"@version" => "1",
"@timestamp" => "2015-08-06T12:52:15.854Z",
"type" => "test",
"tags" => [
[0] "_grokparsefailure"
]
}
if I try to comment the grok statement. And just use date
{
"logstoretime" => "2015-08-04 18:34:14.747000 +00:00",
"@version" => "1",
"@timestamp" => "2015-08-06T13:07:39.212Z",
"type" => "test"
}
{
"logstoretime" => "2015-08-04 18:34:18.661000 +00:00",
"@version" => "1",
"@timestamp" => "2015-08-06T13:07:39.214Z",
"type" => "test"
}
Oracle 11g and logstash 1.5.1
Just tried to delete the YYYY-MM-dd field in the date filter so it only has time and similar output no errors... I thought it would at least say date not matching:
{
"logstoretime" => "2015-08-04 18:34:14.747000 +00:00",
"@version" => "1",
"@timestamp" => "2015-08-06T13:30:48.389Z",
"type" => "test"
}
{
"logstoretime" => "2015-08-04 18:34:18.661000 +00:00",
"@version" => "1",
"@timestamp" => "2015-08-06T13:30:48.392Z",
"type" => "test"
}
Is there a way to use this as the statement it works well in the river, but errors show up when I am using the plugin:
select creation_time as \"@timestamp\" from log;