This repository has been archived by the owner on Aug 27, 2021. It is now read-only.
/
logstash.conf
102 lines (97 loc) · 2.43 KB
/
logstash.conf
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
input {
kafka {
bootstrap_servers => "kafka:9092"
topics => ["logstash-log"]
codec => "json"
}
}
output {
if "nova" in [tags] {
if [node_service] == "nova-api" {
if [log_module] == "nova.osapi_compute.wsgi.server" {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-nova-api-osapi_compute-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
} else if [log_module] == "nova.metadata.wsgi.server" {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-nova-api-metadata-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
} else if [node_service] == "nova-compute" {
if [log_module] == "nova.compute.resource_tracker" {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-nova-compute-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
} else {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-nova-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
}
else if "neutron" in [tags] {
if [node_service] == "neutron-server" {
if [log_module] == "neutron.wsgi" {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-neutron-server-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
} else {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-neutron-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
}
else if "cinder" in [tags] {
if [node_service] == "cinder-api" {
if [log_module] == "eventlet.wsgi.server" {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-cinder-api-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
} else {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-cinder-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
}
else if "keystone" in [tags] {
if [node_service] == "keystone" {
if [log_module] == "eventlet.wsgi.server" {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-keystone-api-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
} else {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-keystone-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
} else {
elasticsearch {
hosts => "elasticsearch:9200"
codec => "json"
index => "os-%{region}-%{node_source}-%{+YYYY.MM.dd}"
}
}
}