<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Thanks for the answer. Thats what i needed to know. And now I now that the nc of the server is too old, no -U option :P
<div><br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF719348" style="direction: ltr;"><font face="Tahoma" size="2" color="#000000"><b>Von:</b> syslog-ng-bounces@lists.balabit.hu [syslog-ng-bounces@lists.balabit.hu]&quot; im Auftrag von &quot;Balint Kovacs [balint.kovacs@balabit.com]<br>
<b>Gesendet:</b> Dienstag, 8. Januar 2013 11:09<br>
<b>An:</b> syslog-ng@lists.balabit.hu<br>
<b>Betreff:</b> Re: [syslog-ng] getting syslog stats without syslog-ng-ctl?<br>
</font><br>
</div>
<div></div>
<div>
<div class="moz-cite-prefix">Hi,<br>
<br>
it is quite easy, all that syslog-ng-ctl does is that it writes &quot;STATS\n&quot; 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 type="cite"><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.&nbsp;</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" target="_blank"></fieldset> <br>
<pre>______________________________________________________________________________
Member info: <a class="moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">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" target="_blank">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" target="_blank">http://www.balabit.com/wiki/syslog-ng-faq</a>

</pre>
</blockquote>
<br>
</div>
</div>
</div>
</div>
<style type="text/css"></style>
</body>
</html>