Skip to content

Commit 3bff30d

Browse files
authored
Update data-collection-syslog.md
1 parent dfb5073 commit 3bff30d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

articles/azure-monitor/agents/data-collection-syslog.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,25 @@ queue.dequeueBatchSize="2048"
151151
queue.saveonshutdown="on"
152152
target="127.0.0.1" Port="28330" Protocol="tcp")
153153
```
154-
154+
155+
>[!Note]
156+
>The following configuration is used when you use SELinux and we decide to use Unix sockets.
157+
```
158+
$ cat /etc/rsyslog.d/10-azuremonitoragent.conf
159+
# Azure Monitor Agent configuration: forward logs to azuremonitoragent
160+
$OMUxSockSocket /run/azuremonitoragent/default_syslog.socket
161+
template(name="AMA_RSYSLOG_TraditionalForwardFormat" type="string" string="<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%")
162+
$OMUxSockDefaultTemplate AMA_RSYSLOG_TraditionalForwardFormat
163+
# Forwarding all events through Unix Domain Socket
164+
*.* :omuxsock:
165+
```
166+
167+
```
168+
$ cat /etc/rsyslog.d/05-azuremonitoragent-loadomuxsock.conf
169+
# Azure Monitor Agent configuration: load rsyslog forwarding module.
170+
$ModLoad omuxsock
171+
```
172+
155173
On some legacy systems, such as CentOS 7.3, we've seen rsyslog log formatting issues when a traditional forwarding format is used to send Syslog events to Azure Monitor Agent. For these systems, Azure Monitor Agent automatically places a legacy forwarder template instead:
156174

157175
`template(name="AMA_RSYSLOG_TraditionalForwardFormat" type="string" string="%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n")`

0 commit comments

Comments
 (0)