-
Notifications
You must be signed in to change notification settings - Fork 0
/
csv-countries.conf
40 lines (37 loc) · 1.13 KB
/
csv-countries.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
input {
file {
path => "C:/data/countries.csv"
start_position => "beginning"
sincedb_path => "nul"
}
}
filter {
csv {
separator => ","
skip_header => true
columns => ["id", "name", "iso3", "iso2", "numeric_code", "phone_code", "capital", "currency", "currency_name", "currency_symbol", "tld", "native", "region", "region_id", "subregion", "subregion_id", "nationality", "timezones", "latitude", "longitude", "emoji", "emojiU"]
}
mutate {
remove_field => ["iso2", "numeric_code", "phone_code", "capital", "currency_name", "currency_symbol", "tld", "native", "region", "region_id", "subregion", "subregion_id", "nationality", "timezones", "emoji", "emojiU"]
remove_field => ["@timestamp", "@version", "host", "log", "message", "event"]
uppercase => ["name"]
rename => { "iso3" => "code" }
convert => {
"id" => "integer"
"latitude" => "float"
"longitude" => "float"
}
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "countries"
document_id => "%{id}"
}
stdout {
codec => line {
format => "%{id} - %{code} - %{name}"
}
}
}