Skip to main content

Syslog Server Profile Models

Overview

The Syslog Server Profile models provide a structured way to manage syslog server profile objects in Palo Alto Networks' Strata Cloud Manager. These models support defining configurations for syslog servers that can receive logs from the Strata Cloud Manager. The models handle validation of inputs and outputs when interacting with the SCM API.

Models

The module provides the following Pydantic models:

  • EscapingModel: Represents character escaping configuration for syslog messages
  • FormatModel: Defines format settings for different log types
  • SyslogServerModel: Represents a server configuration within a syslog server profile
  • SyslogServerProfileBaseModel: Base model with fields common to all syslog server profile operations
  • SyslogServerProfileCreateModel: Model for creating new syslog server profiles
  • SyslogServerProfileUpdateModel: Model for updating existing syslog server profiles
  • SyslogServerProfileResponseModel: Response model for syslog server profile operations

All models use extra="forbid" configuration, which rejects any fields not explicitly defined in the model.

Component Models

EscapingModel

The EscapingModel represents character escaping configuration for syslog messages.

AttributeTypeRequiredDefaultDescription
escape_characterOptional[str]NoNoneEscape sequence delimiter (max length: 1)
escaped_charactersOptional[str]NoNoneCharacters to be escaped without spaces (max length: 255)

FormatModel

The FormatModel represents format settings for different log types in a syslog server profile.

AttributeTypeRequiredDefaultDescription
escapingOptional[EscapingModel]NoNoneCharacter escaping configuration
trafficOptional[str]NoNoneFormat for traffic logs
threatOptional[str]NoNoneFormat for threat logs
wildfireOptional[str]NoNoneFormat for wildfire logs
urlOptional[str]NoNoneFormat for URL logs
dataOptional[str]NoNoneFormat for data logs
gtpOptional[str]NoNoneFormat for GTP logs
sctpOptional[str]NoNoneFormat for SCTP logs
tunnelOptional[str]NoNoneFormat for tunnel logs
authOptional[str]NoNoneFormat for authentication logs
useridOptional[str]NoNoneFormat for user ID logs
iptagOptional[str]NoNoneFormat for IP tag logs
decryptionOptional[str]NoNoneFormat for decryption logs
configOptional[str]NoNoneFormat for configuration logs
systemOptional[str]NoNoneFormat for system logs
globalprotectOptional[str]NoNoneFormat for GlobalProtect logs
hip_matchOptional[str]NoNoneFormat for HIP match logs
correlationOptional[str]NoNoneFormat for correlation logs

SyslogServerModel

The SyslogServerModel represents a server configuration within a syslog server profile.

AttributeTypeRequiredDefaultDescription
namestrYesNoneSyslog server name
serverstrYesNoneSyslog server address
transportLiteral["UDP", "TCP"]YesNoneTransport protocol for the syslog server
portintYesNoneSyslog server port (1-65535)
formatLiteral["BSD", "IETF"]YesNoneSyslog format
facilityLiteral["LOG_USER", ...]YesNoneSyslog facility

Base Models

SyslogServerProfileBaseModel

The SyslogServerProfileBaseModel contains fields common to all syslog server profile CRUD operations.

AttributeTypeRequiredDefaultDescription
namestrYesNoneThe name of the syslog server profile (max length: 31)
serverList[SyslogServerModel]YesNoneList of server configurations
formatOptional[FormatModel]NoNoneFormat settings for different log types
folderOptional[str]No*NoneThe folder in which the resource is defined (max length: 64)
snippetOptional[str]No*NoneThe snippet in which the resource is defined (max length: 64)
deviceOptional[str]No*NoneThe device in which the resource is defined (max length: 64)

* Exactly one container type (folder/snippet/device) must be provided for create operations

SyslogServerProfileCreateModel

The SyslogServerProfileCreateModel extends the base model and includes validation to ensure that exactly one container type is provided.

AttributeTypeRequiredDefaultDescription
All attributes from SyslogServerProfileBaseModel

When creating a syslog server profile, exactly one container type (folder, snippet, or device) must be provided.

SyslogServerProfileUpdateModel

The SyslogServerProfileUpdateModel extends the base model and adds the ID field required for updating existing syslog server profiles.

AttributeTypeRequiredDefaultDescription
idUUIDYes-The UUID of the syslog server profile
All attributes from SyslogServerProfileBaseModel

SyslogServerProfileResponseModel

The SyslogServerProfileResponseModel extends the base model and includes the ID field returned in API responses.

AttributeTypeRequiredDefaultDescription
idUUIDYes-The UUID of the syslog server profile
All attributes from SyslogServerProfileBaseModel

Usage Examples

Creating a Basic Syslog Server Profile with UDP Transport

from scm.client import Scm

# Initialize client
client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id"
)

# Using dictionary
syslog_profile_data = {
"name": "basic-syslog-profile",
"server": [
{
"name": "primary-syslog",
"server": "192.168.1.100",
"transport": "UDP",
"port": 514,
"format": "BSD",
"facility": "LOG_USER"
}
],
"folder": "Shared"
}

response = client.syslog_server_profile.create(syslog_profile_data)
print(f"Created syslog profile: {response.name} (ID: {response.id})")

Creating a Profile with TCP Transport and Custom Formatting

# Using dictionary with TCP transport and custom formatting
tcp_profile_data = {
"name": "advanced-syslog-profile",
"server": [
{
"name": "secure-syslog",
"server": "logs.example.com",
"transport": "TCP",
"port": 1514,
"format": "IETF",
"facility": "LOG_LOCAL0"
}
],
"format": {
"escaping": {
"escape_character": "\\",
"escaped_characters": ",\""
},
"traffic": "hostname,$time,$src,$dst,$proto,$sport,$dport",
"threat": "hostname,$time,$src,$dst,$threatid,$severity",
"system": "hostname,$time,$severity,$result"
},
"device": "My Device"
}

response = client.syslog_server_profile.create(tcp_profile_data)
print(f"Created advanced profile: {response.name}")

Creating a Profile with Multiple Servers

# Using dictionary with multiple servers
multi_server_data = {
"name": "multi-server-profile",
"server": [
{
"name": "primary",
"server": "192.168.1.100",
"transport": "TCP",
"port": 1514,
"format": "IETF",
"facility": "LOG_LOCAL0"
},
{
"name": "backup",
"server": "192.168.1.101",
"transport": "TCP",
"port": 1514,
"format": "IETF",
"facility": "LOG_LOCAL1"
}
],
"snippet": "My Snippet"
}

response = client.syslog_server_profile.create(multi_server_data)
print(f"Created multi-server profile: {response.name}")

Updating an Existing Syslog Server Profile

# Fetch existing profile
existing = client.syslog_server_profile.fetch(name="basic-syslog-profile", folder="Shared")

# Modify attributes using dot notation
existing.server[0].server = "new-logs.example.com"
existing.server[0].port = 1514

# Add format settings
existing.format = {
"traffic": "$time,$src,$dst,$proto,$rule,$action",
"threat": "$time,$src,$dst,$threatid,$severity,$action"
}

# Pass modified object to update()
updated = client.syslog_server_profile.update(existing)
print(f"Updated profile: {updated.name}")