Hi fellow members.

I am rather new to rsyslog and I am struggling with one problem thus
looking for help. My syslog server listen on about 2000 udp sockets and
counting. I am missing property that could identify input socket number on
which the message arrives, or the port number to which the message was sent
by syslog client (same thing). This way it would be possible to heavily
optimise my rsyslog config (now its like 1500KiB in size and counting).
Every time I need to enable new input sockets my config bloats dramatically
cause of templates and rulesets which  dependens on socket/port numbers in
my setup (need new template for every input socket cause dynafile path
depends on socket/port number, this also implies unique ruleset with proper
dynafile template for every input socket). Eg:


  template(name="myPathTemplate_____65514" type="string"
string="/var/log/%$year%/%$month%/65514/%$day%/65514--%$year%-%$month%-%$day%.log")
  template(name="myPathTemplate_____65515" type="string"
string="/var/log/%$year%/%$month%/65515/%$day%/65515--%$year%-%$month%-%$day%.log")
  template(name="myPathTemplate_____65516" type="string"
string="/var/log/%$year%/%$month%/65516/%$day%/65516--%$year%-%$month%-%$day%.log")
  (...)

  ruleset(
name="ruleset_output_t_myMsgTmpl_df___65514") {
          action(type="omfile" template="myMessageTemplate"
dynafile="myPathTemplate_____65514")
  }
  ruleset(
name="ruleset_output_t_myMsgTmpl_df___65515") {
          action(type="omfile" template="myMessageTemplate"
dynafile="myPathTemplate_____65515")
  }
  ruleset(
name="ruleset_output_t_myMsgTmpl_df___65516") {
          action(type="omfile" template="myMessageTemplate"
dynafile="myPathTemplate_____65516")
  }
  (...)

  input(type="imudp" port="65514"
ruleset="ruleset_output_t_myMsgTmpl_df___65514")
  input(type="imudp" port="65515"
ruleset="ruleset_output_t_myMsgTmpl_df___65515")
  input(type="imudp" port="65516"
ruleset="ruleset_output_t_myMsgTmpl_df___65516")
  (...)


Having the ability to use input socket number or destination port number of
syslog message as property would result in much smaller and cleaner config
file, eg:

  template(name="myPathTemplate_____generic" type="string"
string="/var/log/provisioning/%$year%/%$month%/%$SOCKET_NUMBER_AS_PROPERTY_VARIABLE%/%$day%/%$SOCKET_NUMBER_AS_PROPERTY_VARIABLE%--%$year%-%$month%-%$day%.log")

  ruleset(
name="ruleset_output_t_myMsgTmpl_df___generic") {
          action(type="omfile" template="myMessageTemplate"
dynafile="myPathTemplate_____deneric")
  }

  input(type="imudp" port=["65514","65515","65516","..."]
ruleset="ruleset_output_t_myMsgTmpl_df___generic")

And thats all!


Does anyone know if such config is possible now (v7, v6, v5)? Maybe there
is some other way to achieve same results. If so, could someone please give
me some advice? Thank you in advance.


btw. Could one use port range in input statement like port="65514-65535"?
Is this possible?

Greets.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
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.

Reply via email to