[Logstash] 신도리코 복합기 ms-sql db 연동
- IT2/elk stack
- 2023. 2. 5. 22:43
반응형
[INPUT]
input {
jdbc {
jdbc_validate_connection => true
jdbc_driver_library => "/appdata/logstash/jdbc_driver_library/mssql-jdbc-10.2.0.jre11.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://10.25.1.150:1433;databasename=SINDOH;encrypt=false;"
jdbc_user => "viewer_user"
jdbc_password => "P@ssw0rd"
jdbc_default_timezone => "Asia/Seoul"
schedule => "50 13 * * *"
statement => "SELECT * FROM v_job_log WHERE job_date BETWEEN DATEADD(DAY, -1, CONVERT(date,GETDATE())) AND CONVERT(date,GETDATE()));" // 해당 뷰테이블 하루 전날 로그 가져오기
# statement => "SELECT * FROM v_job_log;" // 해당 뷰테이블 전체 로그 가져오기
jdbc_validation_timeout => 100000
}
}
[FILTER]
filter {
date {
match => ["job_time","yyyy-MM-dd HH:mm:ss"]
timezone => "Asia/Seoul"
target => "job_time"
}
mutate {
rename => {
"job_time" => "[event][created]"
}
}
mutate {
copy => {
"[event][created]" => "@timestamp"
}
}
}
[OUTPUT]
output {
# stdout {}
elasticsearch {
hosts => ["https://192.168.0.1:9200", "https://192.168.0.2:9200", "https://192.168.0.3:9200"]
user => "elastic"
password => "P@ssw0rd"
index => "db_sindoh_print_v_job_log"
ssl => true
ssl_certificate_verification => false
cacert => "/usr/share/logstash/elasticsearch-ca.pem"
}
}
반응형
'IT2 > elk stack' 카테고리의 다른 글
[Logstash] 설정 파일 (0) | 2023.02.06 |
---|---|
[Logstash] ionenet 망연계 mysql db 연동 (0) | 2023.02.05 |
[Logstash] secuve tos mariadb 연동 (0) | 2023.02.04 |
[Logstash] wapple syslog 연동 (0) | 2023.02.03 |
[Logstash] MFI IPS syslog 연동 (0) | 2023.02.02 |