-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathes.js
71 lines (70 loc) · 2.02 KB
/
es.js
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
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host: '172.17.102.177:9200',
log: 'trace'
});
var hits;
client.search(
{
"query": {
"bool": {
"must": [
{
"query_string": {
"default_field": "wcs_logs.filename",
"query": "SystemOut.log"
}
},
{
"query_string": {
"default_field": "wcs_logs.host",
"query": "rftwwapp*"
}
},
{
"query_string": {
"default_field": "_all",
"query": "*CertPathValidatorException*"
}
},
{
"query_string": {
"default_field": "wcs_logs.t",
"query": "A"
}
},
{
"query_string": {
"default_field": "wcs_logs.component",
"query": "ConnectionEve"
}
},
{
"range": {
"wcs_logs.@timestamp": {
"from": "now-6h"
}
}
}
],
"must_not": [],
"should": []
}
},
"from": 0,
"size": 10,
"sort": [],
"facets": {},
"fields": [
"host",
"path"
]
}
).then(function (resp) {
hits = resp.hits.hits;
client.close()
}, function (err) {
console.trace(err.message);
client.close()
});
console.log(hits);