<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi, <br>
i wrote a program destination (in python) that parse a message and
insert data in redis.<br>
<br>
My code is:<br>
<small>import re<br>
import fileinput<br>
import redis<br>
<br>
r = redis.Redis(host="127.0.0.1", port=6379, db=0)<br>
<br>
for line in fileinput.input():<br>
tid = re.search('X-TransactionId: (.+?) ', line)<br>
#print tid.group(1)<br>
regexp_result = re.findall(" Recipient:
([A-z0-9._%+-]+@[A-z0-9.-]+)", line)<br>
for email in regexp_result:<br>
r.sadd(tid.group(1)+"_recs", email)</small><br>
<br>
I configure my destination in this way:<br>
<small>destination python_to_file {<br>
program("/usr/bin/python
/etc/syslog-ng/python/Ric_acc_dest.py" flush-lines(1));<br>
};</small><br>
<br>
It works only if i send many message. If i send only one message it
doesn't insert nothing in redis.<br>
<br>
Any ideas?<br>
<br>
<br>
<br>
<div class="moz-signature">-- <br>
<br>
</div>
</body>
</html>