Can rsyslog hash a string in config file?

Forum for the RSyslog Windows Agent. Here you can ask all questions regarding installation, configuration or occuring problems.

Moderator: rgerhards

Google Ads


Can rsyslog hash a string in config file?

Postby esx » Wed Jan 10, 2018 7:08 pm

Hi Rsyslog
Recently, I want to filter some string(such as 'tag-name' in syslog) dynamically.
I had read the document in rsyslog.com, and it said I can use a expression to filter it.
But the expression just only compare with a constant value but not a dynamic one.
For example, I want hash a tag-name and modulo with some number and send to any output.
like this:
set $!hashval = ...; #hash tag-name in syslog.
if ($!hashval % 20== 1) then call output_1
if ($!hashval % 20== 2) then call output_2
...
ruleset(name="output_1") { action(type="omfwd" template="xxx" Target="10.0.0.1" Port="514" Protocol="udp") }
ruleset(name="output_2") { action(type="omfwd" template="xxx" Target="10.0.0.2" Port="514" Protocol="udp") }
...

so that I can send the same tag-name to a fixed server.
Any ideas?
Thanks!
esx
New
 
Posts: 2
Joined: Wed Jan 10, 2018 6:56 pm

Google Ads


Return to Windows Agent

Who is online

Users browsing this forum: No registered users and 0 guests

cron