Skip to content

Instantly share code, notes, and snippets.

@lastday154
Last active August 2, 2018 09:58
Show Gist options
  • Select an option

  • Save lastday154/9344286fe89f917ea9ae6fc3a6549e36 to your computer and use it in GitHub Desktop.

Select an option

Save lastday154/9344286fe89f917ea9ae6fc3a6549e36 to your computer and use it in GitHub Desktop.
logstash configuration import to elasticsearch
logstash -f ./logstash.config
- AWS Elasticsearch
hosts => "https://search-faq-staging-nwt2m3iq6falf52dhkxc2ia4me.us-east-2.es.amazonaws.com:443"
input {
file {
path => "/Applications/MAMP/htdocs/backend-challange-v2/data/data.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["name", "age", "latitude", "longitude", "monthly income", "experienced"]
}
mutate {
convert => {
"age" => "integer"
"latitude" => "float"
"longitude" => "float"
"monthly income" => "integer"
"experienced" => "boolean"
}
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "people"
document_type => "person"
}
stdout {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment