Last active
June 18, 2022 05:40
-
-
Save dubeyji10/89e39251ee6a814f98b872e2eb41164e to your computer and use it in GitHub Desktop.
logstash used to input csv file to elasticsearch index
This file contains hidden or 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/abhishek/Documents/logstash_use/walmart_cleaned_2.csv" | |
start_position => "beginning" | |
} | |
} | |
filter { | |
csv{ | |
separator => "," | |
columns => ["Index","Store","Date","IsHoliday","Dept","Weekly_Sales","Temperature", | |
"Fuel_Price","MarkDown1","MarkDown2","MarkDown3","MarkDown4","MarkDown5", | |
"CPI","Unemployment","Type","Size"] | |
} | |
mutate {convert => ["Store","integer"]} | |
mutate {convert => ["IsHoliday","integer"]} | |
mutate {convert => ["Dept","integer"]} | |
mutate {convert => ["Weekly_Sales","float"]} | |
mutate {convert => ["Temperature","float"]} | |
mutate {convert => ["Fuel_Price","float"]} | |
mutate {convert => ["MarkDown1","float"]} | |
mutate {convert => ["MarkDown2","float"]} | |
mutate {convert => ["MarkDown3","float"]} | |
mutate {convert => ["MarkDown4","float"]} | |
mutate {convert => ["MarkDown5","float"]} | |
mutate {convert => ["CPI","float"]} | |
mutate {convert => ["Unemployment","float"]} | |
mutate {convert => ["Type","integer"]} | |
mutate {convert => ["Size","integer"]} | |
} | |
output { | |
elasticsearch { | |
hosts => ["http://localhost:9200"] | |
index => "walmartdatasecond" | |
} | |
stdout{} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dashboard
Netflix Data
Netflix Data
Walmart Data