Skip to content

Instantly share code, notes, and snippets.

@nitin-rachabathuni
Created September 14, 2018 23:19
Show Gist options
  • Save nitin-rachabathuni/c332791946402a740476369f66a61708 to your computer and use it in GitHub Desktop.
Save nitin-rachabathuni/c332791946402a740476369f66a61708 to your computer and use it in GitHub Desktop.
logstash local to cloud
input {
file {
path => "/home/nitin/Downloads/zomato-restaurants-data/zomato.csv"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
csv {
separator => ","
columns => ["Restaurant ID", "Restaurant Name", "Country Code", "City", "Address", "Locality", "Locality Verbose", "Longitude", "Latitude", "Cuisines", "Average Cost for two", "Currency", "Has Table booking", "Has Online delivery", "Is delivering now", "Switch to order menu", "Price range", "Aggregate rating", "Rating color", "Rating text", "Votes"]
}
mutate {
convert => {
"Country Code" => "float"
"Longitude" => "float"
"Latitude" => "float"
"Average Cost for two" => "float"
"Price range" => "float"
"Aggregate rating" => "float"
"Votes" => "float"
}
}
mutate {
add_field => { "[location][lat]" => "%{Latitude}" }
add_field => { "[location][lon]" => "%{Longitude}" }
}
}
output {
elasticsearch {
hosts => "https://46bf2df741dd459daf064e87cf502a9f.ap-southeast-1.aws.found.io:9243/"
user => "elastic"
password => "4iVlYa3yJrpG35yvpWKAeumw"
index => "zomato_6"
}
stdout {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment