Thanks for the clarification!

My little script works fine now and I can check errors and/or execute an 
uploaded (via a web interface) rule file on my logs :)

Best regards,

Marien

Le 2014-08-12 23:55, Risto Vaarandi a écrit :
> hi Marien,
> John has already provided a good response to your question, but I'd
> like to add a small comment. As mentioned in the previous discussion,
> sec mirrors all its log messages to standard error, provided that it
> is connected to a terminal. However, if that's not the case (like with
> 2>myfile.log), such mirroring will not take place. As John has already
> recommended, this problem is best resolved by setting up a log file
> with the --log option. However, capturing standard error might still
> be useful, since using 2>file will allow for capturing various
> unexpected error messages from sec and its child processes. For
> instance, if you have started a child process which fails at some
> point and writes a relevant message to standard error, redirecting
> sec's standard error to a file will help to capture such messages.
> Please note that redirection does not work if sec has been started
> with the --detach command line option, since this option directs
> standard error immediately to /dev/null after startup.
>  hope this helps,
> risto
> 
> 2014-08-11 15:19 GMT+03:00 Marien Fressinaud
> <d...@marienfressinaud.fr>:
> 
>> Hi,
>> 
>> I'm facing a problem to get result of SEC standard error. I'm
>> currently
>> writing a software in Python which starts SEC as a subprocess and
>> tests
>> if a rule file is well-written. So I try to catch SEC standard
>> error to
>> get something like:
>> ./rules.sec line 1 (test line): Line not in keyword=value format or
>> non-alphanumeric keyword
>> 
>> ## What did I try and what is the result?
>> Since I didn't have anything on standard output / error in Python,
>> I
>> tried these commands in a terminal:
>> 
>> $ ./sec --input=- --debug=3 --no-tail --conf=./rules.sec
>> ./rules.sec line 1 (test line): Line not in keyword=value format or
>> non-alphanumeric keyword
>> 
>> Result is what I expected so I tried then:
>> 
>> $ ./sec --input=- --debug=3 --no-tail --conf=./rules.sec
>> 2>error_file.txt
>> $ cat error_file.txt
>> 
>> ... But there was nothing in my file!
>> 
>> I'm running on an updated Manjaro (~ Arch) distribution with Gnome
>> Terminal 3.12.
>> SEC is in v2.7.6.
>> 
>> I don't know if this is a bug or if I'm doing something wrong, but
>> maybe
>> someone has already faced this kind of problem?
>> 
>> Thanks!
>> 
>> Marien
>> 
>> 
> ------------------------------------------------------------------------------
>> _______________________________________________
>> Simple-evcorr-users mailing list
>> Simple-evcorr-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users
>> [1]
> 
> 
> 
> Links:
> ------
> [1] 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

Reply via email to