A Python-based system for collecting and processing PulsePoint incident data, designed to run on Cribl Edge nodes.
This system collects active incidents from the PulsePoint API, processes them, and forwards them to a Cribl Stream HEC endpoint for further processing and social media integration.
- Active incident collection from PulsePoint API
- Support for multiple agencies
- Human-readable incident types and dispatch statuses
- Robust error handling and retry logic
- Detailed logging with debug capabilities
- Efficient processing without unnecessary delays
- Comprehensive metrics collection:
- API performance metrics
- Processing duration and rates
- System resource usage
- Success/failure tracking
- Retry attempt monitoring
- Python 3.7+
- Access to PulsePoint API
- Cribl Edge node
- Cribl Stream instance with HEC endpoint
- IFTTT account (for social media integration)
-
Clone the repository:
git clone https://github.com/the-data-sherpa/python-pulsepoint.git cd python-pulsepoint -
Install required packages:
pip install -r requirements.txt
-
Create configuration file:
cp config.example.py config.py
-
Edit
config.pywith your settings:- Set your Cribl HEC endpoint
- Configure your agencies
- Add your Cribl tokens
- Adjust timing settings if needed
- Configure metrics and logging settings
-
Cribl HEC Endpoint:
CRIBL_HEC_ENDPOINT = "https://your-Cribl-instance:8088/services/collector"
-
Agency Configuration:
AGENCIES = [ { "id": "EMS1234", # Your agency ID "name": "County EMS", # Your agency name "cribl_token": "Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # Your Cribl token } ]
MAX_RETRIES: Number of retry attempts for failed requests (default: 3)RETRY_DELAY: Delay between retries in seconds (default: 5)REQUEST_TIMEOUT: API request timeout in seconds (default: 30)ENABLE_DEBUG_LOGGING: Enable detailed debug logging (default: False)METRICS_ENABLED: Enable metrics collection (default: True)
Run the collector:
python pulsepoint_collector.py- Main log file:
pulsepoint.log - Metrics log file:
pulsepoint_metrics.log - Debug logging can be enabled in
config.py - Log format is configurable for both standard and debug logging
The system collects comprehensive metrics including:
- Response times
- Response sizes
- Error rates
- Agency-specific performance
- Processing duration
- Processing rates
- Incident counts
- Error tracking
- CPU usage
- Memory usage
- Thread count
- Resource utilization
- Post success rates
- Payload sizes
- Post duration
- Error tracking
- Never commit
config.pyto version control - Keep your Cribl tokens secure
- Use environment variables for sensitive values in production
- Regularly rotate API keys and tokens
- Metrics logs may contain sensitive information - ensure proper access controls
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
[Your License Here]
[Your Support Information]