forked from FrodeRennemo/VinmonopoletElastic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsystembolagetCsvFileLogstash.conf.txt
45 lines (37 loc) · 1.28 KB
/
systembolagetCsvFileLogstash.conf.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
input {
file {
path => "/Users/tallak.hellebust/dev/Kurs/VinmonopoletElastic/download/sb_produkter.csv"
start_position => "beginning"
codec => plain {
charset=> "UTF-8"
}
}
}
filter {
csv {
columns => ["nr","Artikelid","Varnummer","Namn","Namn2","Prisinklmoms","Pant","Volymiml","PrisPerLiter","Saljstart","Utgatt","Varugrupp","Typ","Stil","Forpackning","Forslutning","Ursprung","Ursprunglandnamn","Producent","Leverantor","Argang","Provadargang","Alkoholhalt","Sortiment","SortimentText","Ekologisk","Etiskt","EtisktEtikett","Koscher","RavarorBeskrivning"]
separator => ";"
quote_char => "¤"
}
if ([nr] =="nr")
{drop{}}
mutate {
#replace Norwegian style decimal separator (,) with something else (.)
gsub => [
"Alkoholhalt","%",""
]
convert => { "Prisinklmoms,Pant,PrisPerLiter,Alkoholhalt,Volymiml" => "float"}
convert => { "Ekologisk,Etiskt,Koscher,Utgatt" => "boolean"}
remove_field => ["Datotid", "message"]
}
}
output {
#stdout{ codec => rubydebug }
elasticsearch {
index => systembolaget
document_type => produkt
template => "mapping_fielddata_sb.json"
template_name => "systembolaget_tpl"
template_overwrite => true
}
}