Forwarding logs to a remote server
Learn how to configure sending system log events from Integrated Analytics System to a remote log server with the
apsyslog utility.
apsyslog changes the configuration file on the rsyslog server
and all the connected nodes. As a result, all configured messages are passed to
rsyslogd and, then, the required messages are redirected to the log
servers.Note: Ports that do not use SSL/TLS connections will not support encrypted
communication.
Before you begin
- The feature can only be configured on the nodes which have the external IP configured.
- You must enable the remote logging server to accept the forwarding messages from nodes.
- You must enable the nodes before configuring any forwarding rule.
- For audit log redirection, the utility configures the file
/etc/audisp/plugins.d/syslog.conf and defines the audit forwarding rule in
rsyslog.conf.The valid audit log facility options are LOG_LOCAL0 through 7. In file /etc/audisp/plugins.d/syslog.conf:
active = yes direction = out path = builtin_syslog type = builtin args = LOG_LOCAL7 #default value as per scripts format = stringCorresponding entry in rsyslog.conf:Local7.* @@<ServerIP:Port>
About this task
Command
syntax:
apsyslog <operation> --server <server:ip> --nodes <all | node0101,node0102> --mode <append|overwrite>The following operations are available:
- apsyslog enable --server <server:ip> --nodes <all | node0101,node0102>
- Enables the feature on the selected nodes.
- apsyslog show --nodes <all | node0101,node0102>
- Shows the list of configured forwarding rules for the selected nodes.
- apsyslog unset --fwdrule <facility.priority> --nodes <all | node0101,node0102>
- Deletes the existing forwarding rules on the selected nodes.
- apsyslog set --diskSpace <2g> --nodes <all | node0101,node0102>
- Sets the disk space limit on the selected nodes.
- apsyslog set --retryCount <5> --nodes <all | node0101,node0102>
- Sets the retry count if remote logging server is unreachable.
- apsyslog disable -nodes <all | node0101,node0102>
- Restores the rsyslog and syslogconfig file on the enabled nodes.
Optional arguments:
- -h, --help
- Shows this help message and exits.
- --server <RemoteServerIP:Port>
- Remote server logging details.
- --fwdRule <facility.priority>
- Facility and priority of log.
- --nodes <all |node0101,node0102>
- List of nodes to be configured. Use comma (,) to separate the nodes.
- --diskSpace <1g>
- Disk space limit for queue, default 1g
- --retryCount <n>
- A number of retries if the remote server logging host is unreachable. Default value is 1.
- --mode <append|overwrite>
- Specifies whether the newly configured rule is to be appended or overwritten. The default value is append. In append mode, the utility adds the new rule to the existing forwarding rule. In overwrite mode, the utility overwrites the existing forwarding rule with the new rule.