<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi,<br>
<br>
it is quite easy, all that syslog-ng-ctl does is that it writes
"STATS\n" into the syslog-ng control socket and displays the
result. I'm not familiar with ruby, but I assume that basic Unix
domain socket read/write is not that hard to do with it. With the
use of netcat you can check that<br>
<br>
<tt>root@lyra:~# nc -U /var/lib/syslog-ng/syslog-ng.ctl</tt><tt><br>
</tt><tt>STATS</tt><tt><br>
</tt><tt>SourceName;SourceId;SourceInstance;State;Type;Number</tt><tt><br>
</tt><tt>center;;received;a;processed;0</tt><tt><br>
</tt><tt>destination;d_messages;;a;processed;751</tt><tt><br>
</tt><tt>src.internal;s_src#2;;a;processed;9</tt><tt><br>
</tt><tt>src.internal;s_src#2;;a;stamp;1357639178</tt><tt><br>
</tt><tt>destination;d_console_all;;a;processed;553</tt><tt><br>
</tt><tt>center;;queued;a;processed;0</tt><tt><br>
</tt><tt>destination;d_console;;a;processed;56</tt><tt><br>
</tt><tt>destination;d_xconsole;;a;processed;553</tt><tt><br>
</tt><tt>global;payload_reallocs;;a;processed;424</tt><tt><br>
</tt><tt>global;sdata_updates;;a;processed;0</tt><tt><br>
</tt><tt>global;msg_clones;;a;processed;0</tt><tt><br>
</tt><tt>source;s_src;;a;processed;7666</tt><tt><br>
</tt><tt>.</tt><tt><br>
</tt><tt>^C</tt><br>
<br>
Balint<br>
<br>
</div>
<blockquote
cite="mid:76DDF0AA52B7BB479A6B9B8B48363A606824338F@xing-exchsvr02.xing.hh"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<style type="text/css" id="owaParaStyle"></style>
<div style="direction: ltr;font-family: Tahoma;color:
#000000;font-size: 10pt;">Hello there,
<div>we are plotting and monitoring lot of data and for this I'm
using a little bash script which does sum up the output of
syslog-ng-ctl. But this is kind of slow with 17k lines to
parse :P</div>
<div>Is there a way to get the stats directly without
syslog-ng-ctl? My goal is to write a ruby script which only
parse the stats i'm needing. </div>
<div><br>
</div>
<div>I'm no developer so please answer admin friendly :)</div>
</div>
<style type="text/css"></style>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">______________________________________________________________________________
Member info: <a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng">https://lists.balabit.hu/mailman/listinfo/syslog-ng</a>
Documentation: <a class="moz-txt-link-freetext" href="http://www.balabit.com/support/documentation/?product=syslog-ng">http://www.balabit.com/support/documentation/?product=syslog-ng</a>
FAQ: <a class="moz-txt-link-freetext" href="http://www.balabit.com/wiki/syslog-ng-faq">http://www.balabit.com/wiki/syslog-ng-faq</a>
</pre>
</blockquote>
<br>
</body>
</html>