Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Feature: Allow 'execute program' (^) as a task in in rulesets #81

Merged
merged 5 commits into from Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -568,6 +568,7 @@ Configures Rsyslog ruleset blocks in rainerscript. There are two elements in the
* `lookup` - Sets a variable to the results of an rsyslog lookup.
* `set` - Set an rsyslog variable
* `call` - call a specific action.
* `exec` - execute the following system command
* `expression_filter` - Filter based on one or more expressions.
* `property_filter` - Filter based on one or more RsyslogD properties.
* `stop` - a Boolean to set if the ruleset ends with a stop or not.
Expand Down Expand Up @@ -609,6 +610,7 @@ rsyslog::server::rulesets:
expr: '$fromhost-ip'
- call: 'action.parse.rawmsg'
- call: 'action.parse.r_msg'
- exec: '/bin/echo'
stop: true
```

Expand Down Expand Up @@ -641,6 +643,7 @@ ruleset (name="ruleset_eth0_514_tcp"
set $.srv = lookup("srv-map", $fromhost-ip);
call action.parse.rawmsg
call action.parse.r_msg
^/bin/echo
stop
}

Expand Down
4 changes: 4 additions & 0 deletions templates/exec.epp
@@ -0,0 +1,4 @@
<%- |
String $value
| -%>
^<%= $value -%>
6 changes: 4 additions & 2 deletions templates/tasks.epp
Expand Up @@ -15,5 +15,7 @@ $tasks
<%= epp('rsyslog/action.epp', { 'action_name' => $cfgval['name'], 'type' => $cfgval['type'], 'facility' => $facility, 'config' => $cfgval['config'],}) %>
<%-} elsif $config == 'stop' { -%>
stop
<%}-%>
<%-}-%>
<%} elsif $config == 'exec' { -%>
<%= epp('rsyslog/exec.epp', { 'value' => $cfgval, }) %><%-%>
<%-}-%>
<%-}-%>