Hello, sorry to bother you, once again I have a question about Logstash input...
I just got back from a 9month medical leave, so im a bit lost i must admit...
anyway, heres the config :
stripped input and output to keep only the jdbc part ( that is not working )
jdbc {
jdbc_driver_library => "/var/lib/logstash/sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://SERVER_IP_ADDRESS:1433;databaseName=DATABASE_NAME"
jdbc_user => "******"
jdbc_password => "******"
# or jdbc_password_filepath => "/path/to/my/password_file"
jdbc_validate_connection => true
statement => "SELECT TBL_VIRUS_LOG.FOUND_DATE, TBL_VIRUS_LOG.VIRUSNAME, TBL_VIRUS_LOG.LOGIN, TBL_VIRUS_LOG.INFECTFILE, TBL_VIRUS_LOG.FILEDIR, TBL_VIRUS_LOG.INFECT_SRC, TBL_CLIENT_INFO.COMP_NAME, TBL_CLIENT_INFO.IP, TBL_CLIENT_INFO.DOMAIN, TBL_CLIENT_INFO.MAC, TBL_CLIENT_INFO.LOGON_USER FROM TBL_VIRUS_LOG INNER JOIN TBL_CLIENT_INFO ON TBL_VIRUS_LOG.UID = TBL_CLIENT_INFO.UID WHERE TBL_CLIENT_INFO.UID > :sql_last_value"
# or statement_filepath => "query.sql"
use_column_value => true
tracking_column => "TBL_CLIENT_INFO.UID"
clean_run => false
record_last_run => true
last_run_metadata_path => "/var/lib/logstash/.logstash_jdbc_last_run_tblviruslog"
#tracking_column_type => "numeric"
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
type => "trendmicro-tblviruslog"
tags => "TBL_VLOG"
}
if "TBL_VLOG" in [tags] {
elasticsearch {
hosts => ["es-client:9200"]
index => "logstash-trendmicro-%{+YYYY.MM.dd}"
document_type => "tm11-tblviruslog"
}
}
The goal here, is to index the virus alert on my trendmicro database ( Microsoft SQL Server 2012 ) without duplicate and such so i can do a "cute graphic for the boss"
anyway ... It is not working, and by not working i mean, Logstash simply wont run after that addition.
heres the log :
18/08/2017 14:47:57Pipeline main started 18/08/2017 14:48:00Java::ComMicrosoftSqlserverJdbc::SQLServerException: Operand type clash: uniqueidentifier is incompatible with smallint: SELECT TOP (1) count(*) AS [COUNT] FROM (SELECT TBL_VIRUS_LOG.FOUND_DATE, TBL_VIRUS_LOG.VIRUSNAME, TBL_VIRUS_LOG.LOGIN, TBL_VIRUS_LOG.INFECTFILE, TBL_VIRUS_LOG.FILEDIR, TBL_VIRUS_LOG.INFECT_SRC, TBL_CLIENT_INFO.COMP_NAME, TBL_CLIENT_INFO.IP, TBL_CLIENT_INFO.DOMAIN, TBL_CLIENT_INFO.MAC, TBL_CLIENT_INFO.LOGON_USER FROM TBL_VIRUS_LOG INNER JOIN TBL_CLIENT_INFO ON TBL_VIRUS_LOG.UID = TBL_CLIENT_INFO.UID WHERE TBL_CLIENT_INFO.UID > 8261) AS [T1] {:level=>:error} 18/08/2017 14:48:00Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Operand type clash: uniqueidentifier is incompatible with smallint>, :level=>:warn} 18/08/2017 14:49:00Java::ComMicrosoftSqlserverJdbc::SQLServerException: Operand type clash: uniqueidentifier is incompatible with smallint: SELECT TOP (1) count(*) AS [COUNT] FROM (SELECT TBL_VIRUS_LOG.FOUND_DATE, TBL_VIRUS_LOG.VIRUSNAME, TBL_VIRUS_LOG.LOGIN, TBL_VIRUS_LOG.INFECTFILE, TBL_VIRUS_LOG.FILEDIR, TBL_VIRUS_LOG.INFECT_SRC, TBL_CLIENT_INFO.COMP_NAME, TBL_CLIENT_INFO.IP, TBL_CLIENT_INFO.DOMAIN, TBL_CLIENT_INFO.MAC, TBL_CLIENT_INFO.LOGON_USER FROM TBL_VIRUS_LOG INNER JOIN TBL_CLIENT_INFO ON TBL_VIRUS_LOG.UID = TBL_CLIENT_INFO.UID WHERE TBL_CLIENT_INFO.UID > 8261) AS [T1] {:level=>:error} 18/08/2017 14:49:00Exception when executing JDBC query {:exception=>#<Sequel::DatabaseError: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Operand type clash: uniqueidentifier is incompatible with smallint>, :level=>:warn}
Thank you for future reply ! deeply appreciated as usual!