Keeping global variables in LS?!

Camden -

Thx for sharing. Looking at this code with my beginner Ruby skills, it looks like you initialize a Map structure, into which you add a Year value which you extract from the Event's timestamp.

The Else clause seems to replace all instances of Jan,Feb, .... Dec with the Year that you've stored in the map previously or current Year.

I understand the concept in general. Some questions on your example:

  1. At what point in the config did you insert this section of the custom code?
  2. What is the scope of this @@map variable? I think this is a class variable... is this what makes it 'persistent' between different events?
  3. Why the choice of a map Enumeration when you're only keeping track of one item?! Just curious

Here is my data and an illustration of what I need to extract and then add to each event:

Just like the illustration shows above, once I encounter the file name that I'm looking for (eg., req_output_ALL_ALL_IC2ECFTD_580.xml) I'd like to preserve that part in some save_variable, and then add it to the end of each of the specific events that will have carefully extracted, while skipping others. In other words, I need to "decorate" certain events with data from the save_variable.

Then, If I encounter another Response File, preserve that one (discard the old one), and then use this new one to decorate the events that follow.

I guess I have no idea if such a feat could be done with "in-line" Ruby code here in this config file, or if it requires a new Filter to be created.