-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogstash.conf
63 lines (55 loc) · 1.33 KB
/
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
58
59
60
61
62
63
input {
file {
path => "/202401_PEP.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
codec => plain {
charset => "UTF-8"
}
}
}
filter {
csv {
separator => ","
skip_header => true
columns => ["CPF", "Name", "FunctionAbbreviation", "FunctionDescription", "FunctionLevel", "AgencyName", "StartDateExercise", "EndDateExercise", "EndDateWaitingPeriod"]
}
mutate {
add_field => {
"date_concatenated" => "%{StartDateExercise} %{EndDateExercise}"
}
}
date {
match => ["StartDateExercise", "dd/MM/yyyy"]
target => "StartDateExercise"
}
if [EndDateExercise] == "Não informada" {
mutate {
remove_field => ["EndDateExercise"]
}
} else {
date {
match => ["EndDateExercise", "dd/MM/yyyy"]
target => "EndDateExercise"
}
}
fingerprint {
source => ["CPF", "Name", "FunctionDescription", "AgencyName"]
method => "SHA256"
target => "[@metadata][document_id]"
}
mutate {
remove_field => [ "message", "host", "path" ]
}
}
output {
# stdout { codec => "rubydebug" }
elasticsearch {
hosts => ["elasticsearch:9200"]
index => "br_pep-%{+YYYY.MM.dd}"
template => "/mapping.json"
template_name => "doc"
template_overwrite => true
document_id => "%{[@metadata][document_id]}"
}
}