Last active
March 7, 2019 19:23
-
-
Save gayanvirajith/d2434cd9884163d550f9b36cbc821a32 to your computer and use it in GitHub Desktop.
Log stash demo with cars dataset
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
`sudo -u logstash /usr/share/logstash/bin/logstash -f /home/gayan/Downloads/log-stash-demo/logstash-cars.config` | |
Setting up on ubuntu 16 thanks to below link: | |
https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-16-04 |
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 => "/home/gayan/Downloads/log-stash-demo/cars.csv" | |
start_position => "beginning" | |
sincedb_path => "/dev/null" | |
} | |
} | |
filter { | |
csv { | |
separator => "," | |
columns => ["maker","model","mileage","manufacture_year","engine_displacement","engine_power","body_type","color_slug","stk_year","transmission","door_count","seat_count","fuel_type","date_created","date_last_seen","price_eur"] | |
} | |
mutate { | |
convert => ["mileage", "integer"] | |
convert => ["price_eur", "float"] | |
convert => ["engine_power", "integer"] | |
convert => ["door_count", "integer"] | |
convert => ["seat_count", "integer"] | |
} | |
} | |
output { | |
elasticsearch { | |
hosts => "localhost" | |
index => "cars" | |
document_type => "sold_cars" | |
} | |
stdout {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment