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
147
148
149
150
151
152
153
154
|
# File 'lib/fluentd/plugin/parser_multiline_websphere_iib_stdout.rb', line 50
def parse(text, &block)
m = @regex.match(text)
unless m
if block_given?
yield nil, nil
return
else
return nil, nil
end
end
record = {}
record["tipolog"] = @tipolog
record["integration_node"] = @integration_node
record["integration_server"] = @integration_server
record["producto"] = @producto
record["ambiente"] = @ambiente
record["eventype"] = "INFO"
record["severity"] = "LOW"
record["severity_level"] = 5
record["hostname"] = Socket.gethostname
m.names.each { |name|
if value = m[name]
case name
when "timestamp"
timestamp = @mutex.synchronize { DateTime.strptime(value,@time_format).strftime(@output_time_format) }
time = @mutex.synchronize { DateTime.strptime(value,@time_format).to_time.to_i }
record[name] = timestamp
when "eventype"
record[name] = value
case record[name]
when "I"
record["eventype"] = "INFO"
record["severity"] = "LOW"
record["severity_level"] = 5
when "D"
record["eventype"] = "DETAIL"
record["severity"] = "LOW"
record["severity_level"] = 6
when "E"
record["eventype"] = "ERROR"
record["severity"] ="HIGH"
record["severity_level"] = 5
when "W"
record["eventype"] = "WARNING"
record["severity"] = "MEDIUM"
record["severity_level"] = 5
when "F"
record["eventype"] = "FATAL"
record["severity"] = "HIGH"
record["severity_level"] = 4
when "C"
record["eventype"] = "CONFIGURATION"
record["severity"] = "MEDIUM"
record["severity_level"] = 5
when "O"
record["eventype"] = "SYSTEM_OUTPUT"
record["severity"] = "LOW"
record["severity_level"] = 5
when "R"
record["eventype"] = "SYSTEM_ERROR"
record["severity"] = "LOW"
record["severity_level"] = 5
when "Z"
record["eventype"] = "NOT_RECOGNIZED"
record["severity"] = "LOW"
record["severity_level"] = 5
end
when "message"
case record["msgid"]
when "PMRM0003I:"
msg = value
if requestMetrics = @regexp_pmrm0003i.match(msg)
record["type"] = requestMetrics["type"]
record["detail"] = requestMetrics["detail"]
record["elapsed"] = requestMetrics["elapsed"]
record["tipolog"] = 'requestmetrics.'+record["tipolog"]
record["mesage"].delete
end
else
record[name] = value
end
else
record[name] = value
end
end
}
if @estimate_current_event
time ||= Engine.now
end
if block_given?
yield time, record
else
return time, record
end
end
|