|
@ -228,8 +228,8 @@ export default { |
|
|
fields: [ |
|
|
fields: [ |
|
|
{ |
|
|
{ |
|
|
name: "message", |
|
|
name: "message", |
|
|
title: "Log", |
|
|
title: "Message", |
|
|
width: "20%", |
|
|
width: "40%", |
|
|
visible: true, |
|
|
visible: true, |
|
|
dataClass: "center aligned", |
|
|
dataClass: "center aligned", |
|
|
}, |
|
|
}, |
|
@ -243,15 +243,16 @@ export default { |
|
|
name: "type", |
|
|
name: "type", |
|
|
titleClass: "center aligned", |
|
|
titleClass: "center aligned", |
|
|
width: "10%", |
|
|
width: "10%", |
|
|
|
|
|
visible: false |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "process_id", |
|
|
name: "process_id", |
|
|
visible: true, |
|
|
visible: false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "app_name", |
|
|
name: "app_name", |
|
|
visible: true, |
|
|
visible: true, |
|
|
title: '<span class="orange"></span>App Name', |
|
|
title: '<span class="orange"></span>App', |
|
|
}, |
|
|
}, |
|
|
// 'timestamp', |
|
|
// 'timestamp', |
|
|
// 'type', |
|
|
// 'type', |
|
@ -306,25 +307,27 @@ export default { |
|
|
], |
|
|
], |
|
|
fields3: [ |
|
|
fields3: [ |
|
|
{ |
|
|
{ |
|
|
name: "container_id", |
|
|
name: "_id", |
|
|
title: "Container_id", |
|
|
title: "_id", |
|
|
width: "13%", |
|
|
width: "13%", |
|
|
|
|
|
visible: false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "log", |
|
|
name: "message", |
|
|
title: "Log", |
|
|
title: "message", |
|
|
width: "40%", |
|
|
width: "40%", |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
name: "container_name", |
|
|
name: "tailed_path", |
|
|
title: "Container Name", |
|
|
title: "Name", |
|
|
width: "17%", |
|
|
width: "27%", |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "source", |
|
|
name: "source", |
|
|
title: "Source", |
|
|
title: "Source", |
|
|
width: "8%", |
|
|
width: "8%", |
|
|
|
|
|
visible: false, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: "time", |
|
|
name: "time", |
|
@ -808,8 +811,8 @@ export default { |
|
|
// console.log("raw before.. " + val.log); |
|
|
// console.log("raw before.. " + val.log); |
|
|
|
|
|
|
|
|
// A bit of edit to fit perfectly into the table |
|
|
// A bit of edit to fit perfectly into the table |
|
|
val.log = val.log.replace(/,/g, ", "); |
|
|
//val.log = val.log.replace(/,/g, ", "); |
|
|
val.log = val.log.replace(/":/g, '": '); |
|
|
//val.log = val.log.replace(/":/g, '": '); |
|
|
// console.log("raw after .. " + val.log); |
|
|
// console.log("raw after .. " + val.log); |
|
|
|
|
|
|
|
|
// Change color of source for ALL RAW table to be able to see the error logs easy |
|
|
// Change color of source for ALL RAW table to be able to see the error logs easy |
|
@ -823,95 +826,18 @@ export default { |
|
|
|
|
|
|
|
|
this.countIndex++; |
|
|
this.countIndex++; |
|
|
this.rawdata.push(val); |
|
|
this.rawdata.push(val); |
|
|
|
|
|
// grep |
|
|
|
|
|
this.$root.$emit("GREP_on_data", val); |
|
|
|
|
|
|
|
|
// Check if the log is by a node_service and change color of the type field |
|
|
var tmp2 = { |
|
|
if (val.tag.includes("node") && this.IsJsonString(val.log)) { |
|
|
message: val.message, |
|
|
var test = JSON.parse(val.log); |
|
|
|
|
|
test.app_name = val.container_name; |
|
|
|
|
|
if (test.type == "out") { |
|
|
|
|
|
test.type = '<div class="outtype" >' + test.type + "</div>"; |
|
|
|
|
|
this.localDataOut.push(test); |
|
|
|
|
|
} else if (test.type == "err") { |
|
|
|
|
|
test.type = '<div class="errtype" >' + test.type + "</div>"; |
|
|
|
|
|
this.localDataError.push(test); |
|
|
|
|
|
} |
|
|
|
|
|
this.localData.push(test); |
|
|
|
|
|
} //check if the log is by the mongodb and change color |
|
|
|
|
|
else if (val.tag.includes("node") && !this.IsJsonString(val.log)) { |
|
|
|
|
|
var tmp2; |
|
|
|
|
|
var type; |
|
|
|
|
|
if (val.source.includes("stdout")) { |
|
|
|
|
|
// console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); |
|
|
|
|
|
//type = '<div class="outtype" >' + val.source + "</div>"; |
|
|
|
|
|
tmp2 = { |
|
|
|
|
|
message: val.log, |
|
|
|
|
|
timestamp: val.time, |
|
|
|
|
|
type: '<div class="outtype" >' + "out" + "</div>", |
|
|
|
|
|
process_id: "-", |
|
|
|
|
|
app_name: val.container_name, |
|
|
|
|
|
}; |
|
|
|
|
|
this.localDataOut.push(tmp2); |
|
|
|
|
|
this.localData.push(tmp2); |
|
|
|
|
|
} else if (val.source.includes("stderr")) { |
|
|
|
|
|
//type = '<div class="outtype" >' + val.source + "</div>"; |
|
|
|
|
|
tmp2 = { |
|
|
|
|
|
message: val.log, |
|
|
|
|
|
timestamp: val.time, |
|
|
timestamp: val.time, |
|
|
type: '<div class="errtype" >' + "err" + "</div>", |
|
|
type: '<div class="errtype" >' + "err" + "</div>", |
|
|
process_id: "-", |
|
|
process_id: "-", |
|
|
app_name: val.container_name, |
|
|
app_name: val.tailed_path, |
|
|
}; |
|
|
}; |
|
|
this.localDataError.push(tmp2); |
|
|
this.localDataError.push(tmp2); |
|
|
this.localData.push(tmp2); |
|
|
this.localData.push(tmp2); |
|
|
} |
|
|
|
|
|
} else if (val.tag.includes("mongodb") && this.IsJsonString(val.log)) { |
|
|
|
|
|
// ========== push data for raw table ============ |
|
|
|
|
|
var tmp = JSON.parse(val.log); |
|
|
|
|
|
|
|
|
|
|
|
if (tmp.s == "I") { |
|
|
|
|
|
tmp.s = '<div class="outtype" >' + tmp.s + "</div>"; |
|
|
|
|
|
this.mongoout.push(tmp); |
|
|
|
|
|
} else { |
|
|
|
|
|
tmp.s = '<div class="errtype" >' + tmp.s + "</div>"; |
|
|
|
|
|
this.mongoerror.push(tmp); |
|
|
|
|
|
} |
|
|
|
|
|
tmp.t = '<div class="mongod">' + JSON.stringify(tmp.t) + "</div>"; |
|
|
|
|
|
this.mongodata.push(tmp); |
|
|
|
|
|
// =========== |
|
|
|
|
|
|
|
|
|
|
|
//msg |
|
|
|
|
|
var tmplog = JSON.parse(val.log); |
|
|
|
|
|
var msg2 = tmplog.msg; |
|
|
|
|
|
|
|
|
|
|
|
//timestam |
|
|
|
|
|
var time = tmplog.t; |
|
|
|
|
|
time = time.$date; |
|
|
|
|
|
var tmp = { |
|
|
|
|
|
message: msg2, |
|
|
|
|
|
timestamp: time, |
|
|
|
|
|
type: "<div class= 'outtype'>out</div>", |
|
|
|
|
|
process_id: "Unknown", |
|
|
|
|
|
app_name: val.container_name, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.localDataOut.push(tmp); |
|
|
|
|
|
this.localData.push(tmp); |
|
|
|
|
|
// console.log("HEY " + JSON.stringify(test)); |
|
|
|
|
|
} else if (val.tag.includes("redis")) { |
|
|
|
|
|
var tmplog = val; |
|
|
|
|
|
//timestamp |
|
|
|
|
|
var time = tmplog.time; |
|
|
|
|
|
var tmp = { |
|
|
|
|
|
message: tmplog.log, |
|
|
|
|
|
timestamp: time, |
|
|
|
|
|
type: "<div class= 'outtype'>out</div>", |
|
|
|
|
|
process_id: "Unknown", |
|
|
|
|
|
app_name: val.container_name, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
this.localDataOut.push(tmp); |
|
|
|
|
|
this.localData.push(tmp); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|