Hi all,
I have the following piece of code where I am just using an orderCounter to count the orders but I end up getting wrong count in my FILE_SAVED logs. I have checked my log file. There isn't any issue in it, and all the groks are working fine as I am getting the right status field against my logs which I add in my groks.
Please let me know if I am doing anything wrong.
if [status] == "FILE_CREATED"
{
ruby
{
init => "@@map = {}"
code => "@@map['orderCounter'] = 0;"
}
}
else if [status] == "ORDER_SAVED"
{
ruby
{
code => "@@map['orderCounter']+=1;"
}
}
else if [status] == "FILE_SAVED"
{
ruby
{
code => "event.set('orderCount', @@map['orderCounter']);"
}
}