-
Notifications
You must be signed in to change notification settings - Fork 1
/
hands-on2
79 lines (72 loc) · 1.51 KB
/
hands-on2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
[ kibana - mapping]
GET _cat/indices
DELETE myrdbms
PUT myrdbms
{
"mappings": {
"myrdbms": {
"properties": {
"age": {
"type": "integer"
},
"cabin": {
"type": "keyword"
},
"embarked": {
"type": "keyword"
},
"fare": {
"type": "float"
},
"name": {
"type": "text"
},
"parch": {
"type": "integer"
},
"passengerid": {
"type": "integer"
},
"pclass": {
"type": "keyword"
},
"sex": {
"type": "keyword"
},
"sibsp": {
"type": "integer"
},
"survived": {
"type": "keyword"
},
"ticket": {
"type": "keyword"
}
}
}
}
}
GET myrdbms/_search
GET myrdbms/_mapping
[logstash - conf]
$ vi rdbms.conf
input {
jdbc {
jdbc_validate_connection => true
jdbc_connection_string => "jdbc:mysql://ec2-13-209-172-77.ap-northeast-2.compute.amazonaws.com:3306/fast"
jdbc_user => "root"
jdbc_password => "password"
jdbc_driver_library => "/home/ec2-user/data/mysql-connector-java-5.1.47.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
statement => "SELECT * FROM titanic"
}
}
output {
elasticsearch {
hosts => ["ec2-13-209-172-77.ap-northeast-2.compute.amazonaws.com:9200"]
index => "myrdbms"
document_type => "myrdbms"
}
#stdout { } #only for develop
}
$ bin/logstash -f rdbms.conf