This configuration file is close to the previous one. This time I made a single 'echo' to a file to create the log message, this makes it
easy for this example to have several time the same message in the log. What we want here is to have kazimir realizes an event every 3 time
a pattern is found. So the event will be realized when 3 messages will be found, when 3 others, and so on. This is just an example to show
variable in action . Before starting, make sure file /tmp/totolog is empty or does not exists (kazimir will re-open it if necessary).
Kazimir: LogFile = /dev/tty ; EventDir = /tmp/eventdir ; OutputDir = /tmp/outputdir ;\
LockFile = /tmp/kazimir.lock ; EventUpdateInt = 5
Log: Name = totolog ; Type = ASCII ; Path = /tmp/totolog ; TimeFormat=NONE
Variable: Name = cpt ; Default = 0 ;
Pattern: Name =TotoWasHere; RegExp =toto was here; Log = totolog ; Let = { $(cpt) +<- 1 ;} ;
Event : Name = TotoEvent ; Window = 10m; Let = { $(cpt) <- 0 ;} ;
Begin
TotoWasHere && ( $(cpt) == 3 )
End
Order: Name = ordre1 ; Event = TotoEvent ; Action = Action1;
Action: Name = Action1 ; Path = echo "I have located Toto 3 times" ;
Then perform echo 'toto was here' once, wait about 5 second then do it again, and so on after a few seconds and see kazimir working.
This time the counter works by being used as a boolean element in the event. This is only an example to show how variable can be used