Created
December 13, 2016 20:09
-
-
Save sebnmuller/14e53753a2c04e0630c35f7617501a14 to your computer and use it in GitHub Desktop.
Logstash Elasticsearch Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => "/Users/sebastienmuller/dev/elastic/5/logstash-5.0.2/bin/produkter.csv" | |
start_position => "beginning" | |
sincedb_path => "/dev/null" | |
codec => plain { charset => "ISO-8859-1" } | |
} | |
#stdin {} | |
} | |
filter { | |
csv { | |
autogenerate_column_names => false | |
separator => ";" | |
columns => ["Datotid","Varenummer","Varenavn","Volum","Pris","Literpris","Varetype","Produktutvalg","Butikkategori","Fylde","Friskhet","Garvestoffer","Bitterhet","Sodme","Farge","Lukt","Smak","Passertil01","Passertil02","Passertil03","Land","Distrikt","Underdistrikt","Argang","Rastoff","Metode","Alkohol","Sukker","Syre","Lagringsgrad","Produsent","Grossist","Distributor","Emballasjetype","Korktype",Vareurl] | |
} | |
mutate { | |
convert => { "Literpris" => "float" } | |
convert => { "Alkohol" => "float" } | |
} | |
} | |
output { | |
stdout { | |
codec => rubydebug | |
} | |
elasticsearch { | |
hosts => [ "188.166.1.221:49200" ] | |
template => "/Users/sebastienmuller/dev/elastic/5/logstash-5.0.2/bin/template.json" | |
template_overwrite => true | |
index => "test" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template" : "unique index name goes here", | |
"settings" : { | |
"index.refresh_interval" : "5s" | |
}, | |
"mappings" : { | |
"_default_" : { | |
"_all" : {"enabled" : true}, | |
"dynamic_templates" : [ { | |
"string_fields" : { | |
"match" : "*", | |
"match_mapping_type" : "string", | |
"mapping" : { | |
"type" : "string", "index" : "analyzed", "omit_norms" : true, | |
"fields" : { | |
"raw" : {"type": "keyword", "ignore_above" : 256} | |
} | |
} | |
} | |
} ], | |
"properties" : { | |
"@version": { "type": "keyword" }, | |
"Literpris": { "type": "float" }, | |
"Alkohol": { "type": "float" } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment