2019-10-06 21:11:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param options
|
|
|
|
* @constructor
|
|
|
|
*/
|
|
|
|
SOC.Query.AlertList = function(
|
|
|
|
options
|
|
|
|
) {
|
|
|
|
|
|
|
|
if (!options) {
|
|
|
|
options = {};
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!options.path) {
|
|
|
|
options.path = '/alerts/_search';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!options.query) {
|
|
|
|
options.query = {
|
|
|
|
"version": false,
|
|
|
|
"size": 200,
|
|
|
|
"sort": [
|
|
|
|
{
|
|
|
|
"priority": {
|
|
|
|
"order": "asc",
|
|
|
|
"unmapped_type": "boolean"
|
|
|
|
},
|
|
|
|
"alert_type.keyword": {
|
|
|
|
"order": "asc",
|
|
|
|
"unmapped_type": "boolean"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"_source": {
|
|
|
|
"includes": ["*"]
|
|
|
|
},
|
|
|
|
"query": {
|
|
|
|
"bool": {
|
|
|
|
"must": [
|
|
|
|
{
|
|
|
|
"range": {
|
|
|
|
"timestamp": {
|
|
|
|
"format": "strict_date_optional_time",
|
2019-10-15 22:21:34 +02:00
|
|
|
"gte": "",
|
|
|
|
"lt": ""
|
2019-10-06 21:11:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SOC.Query.call(
|
|
|
|
this,
|
|
|
|
options
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
SOC.Query.AlertList.prototype = Object.create(SOC.Query.prototype);
|
|
|
|
SOC.Query.AlertList.prototype.constructor = SOC.Query;
|
|
|
|
|
|
|
|
SOC.Query.AlertList.prototype.draw = function(divId, data) {
|
|
|
|
|
|
|
|
google.charts.load(
|
|
|
|
'current',
|
|
|
|
{
|
|
|
|
'packages': ['table']
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
google.charts.setOnLoadCallback(
|
|
|
|
this.drawTable(divId, data)
|
|
|
|
);
|
|
|
|
|
|
|
|
};
|