I was trying to set the action for a context without actually changing
the lifetime. I thought there was a way to do that, but apparently
not.

The following patch changes the set command to allow:

   set context - action

so if the lifetime is - the contexts existing creation time and
lifetime are preserved and it will expire at the same time before the
set call.

This patch changes the function execute_set_action. The patch against
release 2.6.2 is:

--- /tools/sec/bin/sec  2012-01-19 05:43:31.000000000 -0500
+++ sec.1       2012-09-13 23:24:10.468750000 -0400
@@ -4082,14 +4082,16 @@

   log_msg(LOG_DEBUG, "Changing settings for context '$context'");

-  if ($lifetime =~ /^\s*0*(\d+)\s*$/) {
+  if ($lifetime =~ /^\s*0*(\d+|-)\s*$/) {

     $lifetime = $1;

     if (exists($context_list{$context})) {

-      $context_list{$context}->{"Time"} = time();
-      $context_list{$context}->{"Window"} = $lifetime;
+      if ( $lifetime ne "-" ) {
+       $context_list{$context}->{"Time"} = time();
+       $context_list{$context}->{"Window"} = $lifetime;
+      }

       if (scalar(@{$list})) {
         $context_list{$context}->{"Action"} = $list;

Risto what do you think about getting this into a future release?

I use it when analyzing multiline event groups by:

   On start of event create a context that will accumulate
     all lines in the event group. Create it with an action
     that causes the context to report when the lifetime expires.

   Other single rules add elements of the eventgroup till the group
     is identified as one that should not be reported. When this
     happens, set the action list for the context to none.

I still want the context to expire at the same point relative to it's
creation and not relative to the time when it was identified as an
ignorable event group. This patch allows me to do that.

--
                                -- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to