miin29na

[log]logstsah ( 작성중) 본문

IT/log

[log]logstsah ( 작성중)

miin29na 2018. 12. 31. 12:56



logstash download page

https://www.elastic.co/downloads/logstash

zip 버전을 다운받아 원하는 폴더에 압축을 푼다. (이 때, 공백이 포함된 폴더는 오류를 발생)



logstsh outpu plugin install

logstsah-plugin.bat install logstsah-output-jdbc

Validating logstash-output-jdbc

Installing logstash-output-jdbc

Installation successful


ddd

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.
 
input {
    file {
        path => "D:/workspace/iot_core/op-iot-platform/iot_core/thingRegistry-service/logback/spring.log"
#        start_position => beginning
    }
}
filter {
  json {
    source => message
  }
}
output {
    stdout {}
    jdbc {    
        driver_jar_path => "D:/logstash-6.5.4/logstash-6.5.4/lib/mysql-connector-java-5.1.38.jar"
        connection_string => "jdbc:mysql://10.177.204.45:3306/iot_core?user=root&password=digital21!"
        statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ]         
    }
}
 
cs





Comments