-
Notifications
You must be signed in to change notification settings - Fork 0
/
logstash.conf
57 lines (45 loc) · 998 Bytes
/
logstash.conf
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
input {
file {
path => "/var/log/log-generator/app.log"
}
}
filter {
grok {
match => [ "message" , "(?<log_date>%{MONTHDAY}-%{MONTHNUM}-%{YEAR} %{HOUR}:%{MINUTE}:%{SECOND}.[0-9]{3}) \[%{NOTSPACE:thread}\] %{LOGLEVEL:log_level} %{NOTSPACE:classname} - %{GREEDYDATA:log_msg}" ]
}
date {
match => ["log_date","dd-MM-YYYY HH:mm:ss.SSS"]
}
kv {
field_split => "&"
source => "log_msg"
}
if [classname] =~ /SellRequest$/ {
mutate { add_tag => "sell" }
} else if [classname] =~ /SearchRequest$/ {
mutate { add_tag => "search" }
}
mutate {
remove_field => [ "log_msg" ]
}
mutate {
convert => [ "id", "integer" ]
}
mutate {
convert => [ "price", "float" ]
}
mutate {
split => [ "options", "|" ]
}
geoip {
source => "ip"
}
useragent {
source => "ua"
target => "useragent"
remove_field => [ "ua" ]
}
}
output {
elasticsearch {}
}