How to code grok filter

Hello, I have the following two lines (they can occur multiple times) in a logfile

2017-05-01 09:21:35 [item_utils.py] INFO: stock_status value after cleanup is OUT_OF_STOCK
2017-05-01 09:21:35 [item_utils.py] INFO: stock_status value after cleanup is IN_STOCK

I want to create 2 variables (in_stock, out_of_stock) to count the times of concurrence of each of the previous two lines, how to do it using grok?

Thanks

Figured it out, %{TIMESTAMP_ISO8601} %{NOTSPACE} %{LOGLEVEL}: stock_status value after cleanup is %{GREEDYDATA:stock_status}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.