forked from jfrog/log-analytics-elastic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfluent.conf.missioncontrol
146 lines (145 loc) · 4.96 KB
/
fluent.conf.missioncontrol
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<source>
@type tail
@id insight_scheduler_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-scheduler-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-scheduler-service.log.pos"
tag jfrog.missioncontrol.insight.scheduler.service
<parse>
@type none
</parse>
</source>
<source>
@type tail
@id insight_server_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-server-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-server-service.log.pos"
tag jfrog.missioncontrol.insight.server.service
<parse>
@type none
</parse>
</source>
<source>
@type tail
@id router_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-service.log.pos"
tag jfrog.missioncontrol.router.service
<parse>
@type none
</parse>
</source>
<source>
@type tail
@id mc_error_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/mc-error.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/mc-error.log.pos"
tag jfrog.missioncontrol.error.service
<parse>
@type none
</parse>
</source>
<source>
@type tail
@id mc_service_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/mc-service.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/mc-service.log.pos"
tag jfrog.missioncontrol.service
<parse>
@type none
</parse>
</source>
<source>
@type tail
@id mc_router_traefik_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-traefik.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-traefik.log.pos"
tag jfrog.missioncontrol.router.traefik
<parse>
@type regexp
expression ^(?<timestamp>[^ ]*) \[(?<service_type>[^\]]*)\] \[(?<log_level>[^\]]*)\] \[(?<trace_id>[^\]]*)\] \[(?<class_line_number>.*)\] \[(?<thread>.*)\] -(?<message>.+)$
</parse>
</source>
<source>
@type tail
@id mc_router_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/router-request.log.pos"
tag jfrog.missioncontrol.router.request
<parse>
@type json
</parse>
</source>
<source>
@type tail
@id insight_server_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-server-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-server-request.log.pos"
tag jfrog.missioncontrol.insight.server.request
<parse>
@type regexp
expression ^(?<timestamp>[^ ]*)\|(?<trace_id>[^\|]*)\|(?<remote_address>[^\|]*)\|(?<username>[^\|]*)\|(?<request_method>[^\|]*)\|(?<request_url>[^\|]*)\|(?<return_status>[^\|]*)\|(?<response_content_length>[^\|]*)\|(?<request_content_length>[^\|]*)\|(?<request_duration>[^\|]*)\|(?<request_user_agent>.+)$
</parse>
</source>
<source>
@type tail
@id insight_scheduler_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-scheduler-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/insight-scheduler-request.log.pos"
tag jfrog.missioncontrol.insight.scheduler.request
<parse>
@type regexp
expression ^(?<timestamp>[^ ]*)\|(?<trace_id>[^\|]*)\|(?<remote_address>[^\|]*)\|(?<username>[^\|]*)\|(?<request_method>[^\|]*)\|(?<request_url>[^\|]*)\|(?<return_status>[^\|]*)\|(?<response_content_length>[^\|]*)\|(?<request_content_length>[^\|]*)\|(?<request_duration>[^\|]*)\|(?<request_user_agent>.+)$
</parse>
</source>
<source>
@type tail
@id mc_request_tail
path "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/mc-request.log"
pos_file "#{ENV['JF_PRODUCT_DATA_INTERNAL']}/log/mc-request.log.pos"
tag jfrog.missioncontrol.service.request
<parse>
@type regexp
expression ^(?<timestamp>[^ ]*)\|(?<trace_id>[^\|]*)\|(?<remote_address>[^\|]*)\|(?<username>[^\|]*)\|(?<request_method>[^\|]*)\|(?<request_url>[^\|]*)\|(?<return_status>[^\|]*)\|(?<response_content_length>[^\|]*)\|(?<request_content_length>[^\|]*)\|(?<request_duration>[^\|]*)\|(?<request_user_agent>.+)$
</parse>
</source>
# STRIP COLOR CODES FROM SERVICE LOGS
<filter jfrog.missioncontrol.**.service>
@type record_transformer
enable_ruby true
<record>
message ${record["message"].gsub(/\e\[([;\d]+)?m/, '')}
</record>
</filter>
# FIELD EXTRACT SERVICE LOG
<filter jfrog.missioncontrol.**.service>
@type parser
key_name message
<parse>
@type multiline
format_firstline /\d{4}-\d{1,2}-\d{1,2}/
format1 /^(?<timestamp>[^ ]*) \[(?<service_type>[^\]]*)\] \[(?<log_level>[^\]]*)\] \[(?<trace_id>[^\]]*)\] \[(?<class_line_number>.*)\] \[(?<thread>.*)\] -(?<message>.*)$/
</parse>
</filter>
<filter jfrog.**>
@type record_transformer
<record>
hostname "#{Socket.gethostname}"
log_source ${tag}
</record>
</filter>
########################
# ELASTIC OUTPUT
########################
<match jfrog.**>
@type elasticsearch
@id elasticsearch
host my_host
port 9200
user my_user
password my_password
index_name unified-missioncontrol
include_tag_key true
type_name fluentd
logstash_format false
</match>
#END ELASTIC OUTPUT