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

Updating params.pp and _common.erb so all the options of localfile can be used #97

Merged
merged 1 commit into from
Dec 27, 2018

Conversation

LuisGi93
Copy link
Contributor

Localfile is used to configure the collection of log data from files, Windows events, and from the output of commands. Right now it has 10 options (location, command, alias, frequency) but only two can be used with Puppet (location and log_format). This PR solves that. It allows to define the options for localfiles using hashes. For example if we wanted to define the following localfiles to ossec.conf:

<localfile>
  <log_format>syslog</log_format>
  <location>/var/log/syslog</location>
</localfile>

<localfile>
  <log_format>command</log_format>
  <command>df -P</command>
  <frequency>360</frequency>
</localfile>

<localfile>
  <log_format>syslog</log_format>
  <location>/var/log/auth.log</location>
  <target>agent,custom_socket</target>
  <out_format target="custom_socket">$(timestamp %Y-%m-%d %H:%M:%S): $(log)</out_format>
</localfile>

We would write:

[
            {  'location' => '/var/log/syslog' , 'log_format' => 'syslog'},
            {  'command' => 'df -P' , 'log_format' => 'command',  'frequency => '360'},
            {  'location' => '/var/log/auth.log' , 'log_format' => 'syslog', 'target' => 'agent,custom_socket', 'out_format' => {'value' => '$(timestamp %Y-%m-%d %H:%M:%S): $(log)' , 'attributes' => {'target' => 'custom_socket'}}},
    
]

This PR also closes #77 , because it adds the default configuration for Windows to the Wazuh agent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants