# CentOS & RHEL Log Integration

**CentOS & RHEL**

**Log Integration Guide**

**Log Integration procedure:**\
\
Follow these steps to configure log forwarding to a remote syslog server.

1. Install syslog package if you haven’t installed it.

`#yum -y install rsyslog`

1. Checking the rsyslog.conf

Open a rsyslog.conf file located at /etc/rsyslog.conf by following command.

`vim /etc/rsyslog.conf`

At the end of the file check for the following line and uncomment

\#Include all config files in /etc/rsyslog.d/

`$IncludeConfig /etc/rsyslog.d/*.conf`

<figure><img src="/files/DIo08l5SisDT3rwXiEY1" alt=""><figcaption></figcaption></figure>

Add below line at end of the file.

`*.* @<Log Collector IP>:12514`

<figure><img src="/files/tnSaFFGovz3mZ48ypuA9" alt=""><figcaption></figcaption></figure>

Note: 514 port is the syslog default port number. Please replace 514 with blusapphire shared port number and provide log collector private IP.

Save and quit the configuration file.

Create log configuration for Audit logs with vim /etc/rsyslog.d/auditlog.conf and paste following lines below:

`$ModLoad imfile`

`auditd audit.log`

`$InputFileName /var/log/audit/audit.log ##path of log file`

`$InputFileTag tag_audit_log:`

`$InputFileStateFile audit_log`

`$InputFileSeverity info`

`$InputFileFacility local6`

`$InputFilePollInterval 1`

`$InputFilePersistStateInterval 1`

`$InputRunFileMonitor`

`$WorkDirectory /var/lib/rsyslog`

`$ActionQueueFileName fwdRule1 # unique name prefix for spool files`

`$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)`

`$ActionQueueSaveOnShutdown on # save messages to disk on shutdown`

`$ActionQueueType LinkedList # run asynchronously`

`$ActionResumeRetryCount -1`

`local6.* @<Log Collector IP>:12514`

<figure><img src="/files/UsPxFSFWB04aQR0tReuD" alt=""><figcaption></figcaption></figure>

Save and Quit the configuration file.

Navigate to the following directory /create a file using the below command and paste the entire content of the file (all lines) from the git

`#vim /etc/audit/rules.d/audit.rules`

<https://github.com/Neo23x0/auditd/blob/master/audit.rules>

save and quit the file.

Restart rsyslog service

`sudo systemctl restart rsyslog`

`sudo systemctl status rsyslog`

<figure><img src="/files/Ar8bi53kMWqH6xSRMLHh" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blusapphire.io/log-forwarding/03_log-forwarding-guide/log-forward/linux/centos-and-rhel-log-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
