I have a log file which has product id and item sale details on different lines. An example file can be
product id: 2455
Customer Name: xyz1 Price : abc1 Profit: efg1
Customer Name: xyz2 Price : abc2 Profit: efg2
Customer Name: xyz3 Price : abc3 Profit: efg3.
Now, my requirement is that along with name, price and profit, I also need the product id into my elastic search event data. One way to do this is to find the id and append it to all the lines in the file, but I am looking at a more elegant way to do this using only logstash. I have tried using multiple matching in grok, but it is only separately parsing the lines, but I am looking at someway which would retain information from previous lines.