[rsyslog] working with list templates

Brian Knox briank at talksum.com
Mon Jan 7 23:54:15 CET 2013


David - no, I have batch processing working already as part of the patch
I'm working on.  That part was actually pretty easy using rewriting the
plugin to properly use dequeuebatchsize, etc.

The issue is that the way the redis protocol constructs commands means that
I can't just put a message payload with spaces in it right into a command.
  Additionally depending on which redis command is being run, the argument
list is variable length.

This is handled one of two ways in the redis C api.  The first way is using
a sprintf like interface:

redisCommand("HINCRBY %s %s %d", stringvar, stringvar, intvar)

Since I don't want to limit what commands a user of the output plugin can
use, I don't see this interface being usable for this purpose

The second way is by passing a char ** to RedisCommandArgv with some
information about the number of elements in the char and their lengths.

This seems like it would fit well, if I can figure out a convenient way to
pass what I want from the template to the output plugin.

In this case, each member of the char ** is either a redis protocol
keyboard or one of the arguments.

So in that case "HINCRBY", "httpd", "pageviews", "1" could be elements in
the char **, and when passed to RedisCommandArgv, the correct protocol
message would get constructed to send to redis.

As per Rainer's thought.. there may be a way I could potentially use the
string formatting options to "escape" the command into a redis protocol
command,which is a thought that hadn't occurred to me.  I don't know if I
like that approach better yet than my original thoughts, but it at the
least merits some thought.

Thanks for all the discussion on this by the way!

Brian


On Mon, Jan 7, 2013 at 5:18 PM, David Lang <david at lang.hm> wrote:

> On Mon, 7 Jan 2013, Rainer Gerhards wrote:
>
>  The more I read, the more I think what you really want is a single
>> string.  Are we just missing a shell escape property option?
>>
>
> I think that what he is wanting is a single string for each message, but
> he wants to shift to processing a batch of messages rather than one at a
> time.
>
> David Lang
>
> ______________________________**_________________
> rsyslog mailing list
> http://lists.adiscon.net/**mailman/listinfo/rsyslog<http://lists.adiscon.net/mailman/listinfo/rsyslog>
> http://www.rsyslog.com/**professional-services/<http://www.rsyslog.com/professional-services/>
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
> of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
> DON'T LIKE THAT.
>


More information about the rsyslog mailing list