Skip to content

Instantly share code, notes, and snippets.

@DarkcoderSe
Created May 12, 2021 05:56
Show Gist options
  • Save DarkcoderSe/82a15c38d4f20dc9339d7f513a0b4303 to your computer and use it in GitHub Desktop.
Save DarkcoderSe/82a15c38d4f20dc9339d7f513a0b4303 to your computer and use it in GitHub Desktop.
Logstash configuration file to index data
input {
file {
path => "/home/darkcoder/Node/etlapp/db/cdm_uq_hospitals2.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["id","facility_id","code","description","price","original_code","facility_name","address","city","state","zip_code","phone_number","latitude","longitude"]
}
if [latitude] and [longitude] {
mutate { convert => {"latitude" => "float"} }
mutate { convert => {"longitude" => "float"} }
mutate { rename => {"latitude" => "[location][lat]"} }
mutate { rename => {"longitude" => "[location][lon]"} }
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "indexA1"
manage_template => true
}
stdout {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment