forked from cvandeplas/ELK-forensics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathw3c-extended-iis.search-examples.txt
65 lines (63 loc) · 1.52 KB
/
w3c-extended-iis.search-examples.txt
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
# How many usernames per client IP ?
# for FAILED authentications
# keep TOP 50 results
curl -XPOST "http://192.168.43.134:9200/logstash-w3c_extended_iis*/w3c_extended_iis/_search?pretty=true" -d'
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [ {
"terms": { "sc_status": ["401"]}
} ],
"must_not": [ {
"terms": { "sc_status": ["200", "304", "302", "500"] }
} ]
}
}
}
},
"aggs": {
"client_ip": {
"terms": {
"field": "c_ip.raw",
"size": 50,
"order": { "usernames": "desc" }
},
"aggs" : {
"usernames" : { "cardinality": { "field": "cs_username.raw" } }
}
}
}
}' | fgrep -e key -e value
# FIXME not perfect thing, might give incorrect results, needs to be verified
curl -XPOST "http://192.168.43.134:9200/logstash-w3c_extended_iis*/w3c_extended_iis/_search?pretty=true" -d'
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [ {
"terms": { "sc_status": ["401"]}
} ],
"must_not": [ {
"terms": { "sc_status": ["200", "304", "302", "500"] }
} ]
}
}
}
},
"aggs": {
"client_ip": {
"terms": {
"field": "c_ip.raw",
"size": 5
},
"aggs" : {
"usernames" : { "terms": { "field": "cs_username.raw", "size": 100 } }
}
}
}
}'