Overview
Logstash processes incoming syslog messages from Palo Alto Networks firewalls, parses the logs, enriches them with threat intelligence, and forwards them to Elasticsearch. SafeNetworking uses multiple pipelines to handle different log types.Pipeline Architecture
Logstash pipelines are configured in/etc/logstash/pipelines.yml:
- threat - PAN-OS threat, traffic, config, and system logs
- iot - IoT threat detection from edge routers
- gtp - GTP event code processing (optional)
- customer - Custom pipeline for user-specific processing
Threat Pipeline Configuration
The primary pipeline for PAN-OS logs is defined in/etc/logstash/pipelines/threat.conf.
Input Section
Receives syslog messages from PAN-OS firewalls via UDP:- Protocol: UDP syslog
- Port: 5514
- Bind Address: 0.0.0.0 (listens on all interfaces)
- Tag:
PAN-OS_syslog(used for filtering)
Configure your PAN-OS firewalls to send syslog to this server on port 5514. See the PAN-OS documentation for syslog server configuration.
Filter Section - Threat Logs
Parses and enriches threat logs from PAN-OS:DNS Threat Detection
SafeNetworking has specialized logic to detect and parse DNS-related threats:DNS EDL (External Dynamic List)
DNS Cloud Security
DNS Content-Based Threats
- Domain name - The malicious or suspicious domain
- Threat name - Threat classification (EDL, CLOUD, or specific threat)
- Signature number - AutoFocus signature ID
- Tags - For routing to SafeNetworking processors
URL Filtering
Parses URL category threats:GeoIP Enrichment
Adds geographic information for source and destination IPs:- Country, city, region
- Latitude/longitude
- Timezone
- Postal code
GeoIP lookups are skipped for private (RFC1918) IP addresses to save processing time.
Flow Fingerprinting
Creates a unique hash for each network flow:Output Section
Routes parsed logs to appropriate Elasticsearch indices:- Threat logs →
threat-YYYY.MM(monthly indices) - Traffic logs →
traffic-YYYY.MM - System logs →
system-YYYY.MM - Config logs →
config-YYYY.MM - Failed events →
/var/log/logstash/failed_threat_events-YYYY.MM.log
IoT Pipeline Configuration
Processes IoT threat detection logs from edge routers (/etc/logstash/pipelines/iot.conf).
Input Configuration
- Port: 5510
- Tag:
IOT_External
Filter Configuration
- Parses edge router syslog format
- Extracts source/destination IPs
- Looks up destination IP in IoT threat database
- Enriches event with malware classification
Output Configuration
Logstash System Configuration
JVM Memory Settings
Configured in/etc/logstash/config/jvm.options:
Service Management
Adding Custom Pipelines
To add a custom pipeline for specialized processing:Create Pipeline Configuration
Create a new configuration file:Define input, filter, and output sections:
Optional Enrichments
The threat pipeline includes commented-out enrichment options:DNS Resolution
Resolve malicious domains to IPs (use with caution):Customer Database Enrichment
Lookup customer information from Elasticsearch:Troubleshooting
Logstash Not Starting
Check logs:- JVM heap too large for available RAM
- Syntax errors in pipeline configuration
- Port already in use
No Events in Elasticsearch
Verify Logstash is receiving data:Pipeline Errors
Check pipeline status:High Memory Usage
Solutions:- Increase JVM heap in
/etc/logstash/config/jvm.options - Reduce batch size in pipeline configuration
- Split pipelines for better resource distribution
Performance Tuning
Optimize Logstash for high-throughput environments:- workers: Number of parallel processing threads (default: CPU cores)
- batch.size: Events to process per batch (default: 125)
- batch.delay: Max wait time in milliseconds for batch to fill (default: 50)
Related Configuration
- Elasticsearch Configuration - Configure output destination
- AutoFocus API Configuration - Configure threat intelligence source
Source References
Pipeline configurations:install/logstash/pipelines.yml- Pipeline registrationinstall/logstash/threat.conf- Main threat processing pipelineinstall/logstash/iot.conf- IoT threat detection pipelineinstall/logstash/config/jvm.options- JVM memory settingsinstall/setup.sh:93-107- Automated installation script
