Index: bootstrap/css/bootstrap-theme.css =================================================================== diff -u -r9bb4c79525c4bae667b6622e68f388132a8bdc2e -r2b8a11f2b23b18443e7ff59977e934af75e3a827 --- bootstrap/css/bootstrap-theme.css (.../bootstrap-theme.css) (revision 9bb4c79525c4bae667b6622e68f388132a8bdc2e) +++ bootstrap/css/bootstrap-theme.css (.../bootstrap-theme.css) (revision 2b8a11f2b23b18443e7ff59977e934af75e3a827) @@ -487,16 +487,25 @@ var config; $(function() { - var url = ""; + var queryString = ""; + $.getJSON("/api/elasticsearch/topbeat/search/request.json", function (reqdata) { + console.log(reqdata.query.bool.filter[0].bool.should[0].match["beat.hostname"]); + reqdata.query.bool.filter[0].bool.should[0].match["beat.hostname"] = "9eb75e7e6e3e"; + //console.log(reqdata.query.bool.filter[0].bool.should[0].match["beat.hostname"]); + + //console.log(reqdata.query.bool.filter[0].bool.should[0]); + queryString = reqdata; + console.log(JSON.stringify(queryString)); + }); + + var url = ""; var type = ""; if($(location).attr('port') == 9999){ url = "/api/elasticsearch/topbeat/search/api.json"; - queryString = "nonepararm"; type = "get"; }else{ url="/elasticsearch/topbeat-*/_search"; - queryString = "jsonparm"; type = "post"; } @@ -524,8 +533,8 @@ chartData.push(obj.doc_count); }); - console.log(chartLabels); - console.log(chartData); + //console.log(chartLabels); + //console.log(chartData); config = { type: 'radar', Index: api/elasticsearch/topbeat/search/request.json =================================================================== diff -u --- api/elasticsearch/topbeat/search/request.json (revision 0) +++ api/elasticsearch/topbeat/search/request.json (revision 2b8a11f2b23b18443e7ff59977e934af75e3a827) @@ -0,0 +1,57 @@ +{ + "aggs": { + "2": { + "terms": { + "field": "proc.name.keyword", + "order": { + "_count": "desc" + }, + "size": 10 + } + } + }, + "size": 0, + "_source": { + "excludes": [] + }, + "stored_fields": [ + "*" + ], + "script_fields": {}, + "docvalue_fields": [ + { + "field": "@timestamp", + "format": "date_time" + } + ], + "query": { + "bool": { + "must": [], + "filter": [ + { + "bool": { + "should": [ + { + "match": { + "beat.hostname": "" + } + } + ], + "minimum_should_match": 1 + } + }, + { + "range": { + "@timestamp": { + "format": "strict_date_optional_time", + "gte": "2020-12-12T07:33:23.504Z", + "lte": "2020-12-12T07:48:23.504Z" + } + } + } + ], + "should": [], + "must_not": [] + } + } +} \ No newline at end of file