Hi,
I have a csv file that looks like this: The first line is the header column
Item, Type, Category, Q1, Q2, Q3, Q4
Tools, License, Cost Saving, 15000, 0, 6000, 899
I am trying to consume this in Logstash and send the resulting events/documents to elasticsearch. The overall functionality works but what I want is to generate 4 events /documents from each row like this:
Item: Tools
Category: Cost Saving
Type: License
Quarter: Q1
Quarter1_Value : 15000
Item: Tools
Category: Cost Saving
Type: License
Quarter: Q2
Quarter2Value: 0
and so on for Q3 and Q4 too.
My csv filter currently looks like this:
filter {
csv {
columns => ["item","category","type","q1","q2", "q3", "q4"]
add_field => {
"quarter" => "q1"
"amount" => "%{q1}"
}
}
}
But what I am missing is a way to generate 4 events from one single row. Is this possible? And is there another filter that I have to use to accomplish this? I am new to Logstash and any help is greatly appreciated.
Thanks
Probably also need to mutate / remove_field some stuff.