2014-08-18 22:37 GMT+03:00 Yuheng Du <yuhe...@clemson.edu>: > Hi Guys, > > Is there any method to the return value of a script in SingleWithScript > rule? > > I have 8 readings in an array and I want to return which (one or many) > specific items in that array is exceptional using a perl script. Then > based on the return value of the script, I want to decide my actions. > > So I need to return an integer to my rule in order to decide the action. > > Can I use SingleWithScript rule to do this? Or is there any other methods? >
Where exactly is this array created and how it is initialized? Since there is no straightforward way to fetch a child process exit code from rules, it might be simpler to have a PerlFunc pattern for executing the perl code and setting the array. However, if the perl code involves time-consuming external queries, I'd not recommend PerlFunc pattern, since it is not executed asynchronously. In that case, you could try the 'spawn' action for executing the perl script, and communicate with SEC by generating synthetic events from perl script. If you prefer to use SingleWithScript, you can also use the following strategy -- write the exit code value into a file, and have 'if () else ()' statements in your action list for executing different actions based on the content of the file. hope this helps, risto > Thanks. > > best, > > Yuheng > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Simple-evcorr-users mailing list > Simple-evcorr-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users > >
------------------------------------------------------------------------------
_______________________________________________ Simple-evcorr-users mailing list Simple-evcorr-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users