pfSense Logging Configuration
Configure pfSense remote logging for SIEM integration (Wazuh, Splunk, etc.) via REST API v2.
API Endpoint
/api/v2/status/logs/settings
| Method | Description |
|---|---|
GET |
Retrieve current logging settings |
PATCH |
Update logging settings |
Get Current Settings
dsource d000 dev/network
curl -ks "https://${PFSENSE_HOST}/api/v2/status/logs/settings" \
-H "X-API-Key: ${PFSENSE_API_SECRET}" | jq .
{
"code": 200,
"status": "ok",
"data": {
"enableremotelogging": false,
"ipprotocol": null,
"sourceip": null,
"remoteserver": null,
"remoteserver2": null,
"remoteserver3": null,
"logall": null
}
}
Enable Remote Syslog
Configure pfSense to send logs to a remote syslog server (e.g., Wazuh SIEM).
curl -ks "https://${PFSENSE_HOST}/api/v2/status/logs/settings" \
-X PATCH \
-H "X-API-Key: ${PFSENSE_API_SECRET}" \
-H "Content-Type: application/json" \
-d '{
"enableremotelogging": true,
"sourceip": "",
"ipprotocol": "ipv4",
"remoteserver": "10.50.1.120:514",
"logall": true
}' | jq .
{
"code": 200,
"status": "ok",
"response_id": "SUCCESS",
"data": {
"enableremotelogging": true,
"remoteserver": "10.50.1.120:514",
"logall": true
}
}
Parameters
| Parameter | Type | Description |
|---|---|---|
|
boolean |
Enable/disable remote syslog |
|
string |
Source interface: |
|
string |
IP version: |
|
string |
Primary syslog server: |
|
string |
Secondary syslog server (optional) |
|
string |
Tertiary syslog server (optional) |
|
boolean |
Send all log types to remote server |
Selective Logging
Instead of logall: true, send specific log categories:
curl -ks "https://${PFSENSE_HOST}/api/v2/status/logs/settings" \
-X PATCH \
-H "X-API-Key: ${PFSENSE_API_SECRET}" \
-H "Content-Type: application/json" \
-d '{
"enableremotelogging": true,
"sourceip": "",
"ipprotocol": "ipv4",
"remoteserver": "10.50.1.120:514",
"logall": false,
"filter": true,
"dhcp": true,
"auth": true,
"vpn": true,
"system": true
}' | jq .
| Parameter | Log Type |
|---|---|
|
Firewall filter logs |
|
DHCP server logs |
|
Authentication logs |
|
Captive portal logs |
|
VPN (IPsec, OpenVPN) logs |
|
Gateway monitoring logs |
|
Wireless AP logs |
|
System/general logs |
|
DNS resolver logs |
|
PPP/PPPoE logs |
|
Routing daemon logs |
|
NTP daemon logs |
Disable Remote Logging
curl -ks "https://${PFSENSE_HOST}/api/v2/status/logs/settings" \
-X PATCH \
-H "X-API-Key: ${PFSENSE_API_SECRET}" \
-H "Content-Type: application/json" \
-d '{
"enableremotelogging": false
}' | jq .
Verify Syslog Delivery
On the receiving SIEM (e.g., Wazuh):
# Check if logs are arriving
kubectl exec -n wazuh wazuh-manager-master-0 -- \
tail -20 /var/ossec/logs/archives/archives.log | grep -i pfsense
On pfSense (via SSH):
# Check syslog service
sockstat -4 | grep syslog
Integration Examples
Wazuh SIEM
curl -ks "https://${PFSENSE_HOST}/api/v2/status/logs/settings" \
-X PATCH \
-H "X-API-Key: ${PFSENSE_API_SECRET}" \
-H "Content-Type: application/json" \
-d '{
"enableremotelogging": true,
"sourceip": "",
"ipprotocol": "ipv4",
"remoteserver": "10.50.1.120:514",
"logall": true
}' | jq -r '.response_id'
Splunk
curl -ks "https://${PFSENSE_HOST}/api/v2/status/logs/settings" \
-X PATCH \
-H "X-API-Key: ${PFSENSE_API_SECRET}" \
-H "Content-Type: application/json" \
-d '{
"enableremotelogging": true,
"sourceip": "",
"ipprotocol": "ipv4",
"remoteserver": "splunk.example.com:514",
"logall": true
}' | jq -r '.response_id'