A Kubernetes-aware log analysis tool for IBM FileNet Content Platform Engine (CPE).
This utility helps you analyze CPE log files β either from local directories or directly from OpenShift / Kubernetes pods.
It automatically collects, filters, and summarizes log errors and warnings, then generates human-readable reports (Markdown, CSV, or PDF with charts).
It is designed for containerized FileNet deployments (e.g., Cloud Pak for Business Automation) and is especially useful for:
- Migration & health-check scenarios
- Offline analysis on developer notebooks
- Environments with autoscaling or ephemeral pods
Install Python (3.8+) and the required libraries:
pip install -r requirements.txtIf you want to collect logs directly from a running CPE pod, install and configure kubectl:
# Verify your cluster connection
kubectl get pods -n filenetgit clone https://github.com/mod242/cpe-loganalyzer.git
cd cpe-loganalyzer
chmod +x filenet_cpe_log_analyzer.pyAnalyze existing local FileNet CPE logs (e.g. from /opt/ibm/wlp/usr/servers/defaultServer/FileNet):
python filenet_cpe_log_analyzer.py /home/user/logs \
--pattern "ce_system*.log" \
--since "24h" \
--outdir ./results \
--pdf-report ./results/filenet_cpe_report.pdf \
--pdf-title "FileNet CPE Error Summary (Last 24h)" \
--pdf-landscapeThis will:
- Scan logs recursively
- Extract all WARN and ERROR entries from the last 24 hours
- Consolidate frequent errors
- Generate:
summary_markdown.md- CSV exports (summary, examples, timeseries)
filenet_cpe_report.pdfwith charts and formatted tables
If your FileNet CPE runs on Kubernetes/OpenShift, the script can directly copy matching log files from a running pod.
python filenet_cpe_log_analyzer.py /home/user/analyze \
--kube-sync \
--kube-single \
--kube-flatten \
--kube-namespace filenet \
--kube-pod-prefix demo-cpe-deploy \
--kube-container demo-cpe-deploy \
--kube-remote-path /opt/ibm/wlp/usr/servers/defaultServer/FileNet \
--kube-local-path /home/user/analyze \
--kube-file-pattern "ce_system*.log" \
--pattern "ce_system*.log" \
--since "24h" \
--outdir ./results \
--pdf-report ./results/filenet_cpe_report.pdf \
--html-report ./results/filenet_cpe_report.html \
--pdf-title "FileNet CPE Kubernetes Logs β Last 24h" \
--html-title "FileNet CPE Kubernetes Logs β Last 24h" \
--pdf-landscape- Finds the running pod matching prefix
demo-cpe-deploy-*in namespacefilenet - Executes:
(Only matching logs are streamed locally)
find . -type f -name "ce_system*.log" -print0 | \ tar --null -T - -czf - | tar -xzf - -C <localdir>
- Analyzes the downloaded files
- Produces Markdown, CSV, PDF, and HTML reports
# Generate HTML report for local logs
python filenet_cpe_log_analyzer.py /path/to/logs \
--html-report ./error_analysis.html
# HTML report with custom title and time window
python filenet_cpe_log_analyzer.py /path/to/logs \
--since "7d" \
--html-report ./weekly_report.html \
--html-title "Weekly FileNet Error Analysis"
# Generate both PDF and HTML reports
python filenet_cpe_log_analyzer.py /path/to/logs \
--pdf-report ./report.pdf \
--html-report ./report.html \
--outdir ./analysis_resultsThe generated PDF includes:
- Title page with timestamp (and optional logo)
- Top error families (wrapped labels)
- Error count per day/hour
- Consolidated error table
- Example log messages per family
Charts included:
- Top error families (horizontal bar chart)
- Errors per day
- Errors per hour
The HTML report provides a modern, interactive web-based view with:
- π Interactive Charts: Bar charts and line graphs using Chart.js
- π Statistics Dashboard: Key metrics displayed in attractive cards
- π Expandable Error Details: Click "Show Examples" to view actual log entries
- π± Responsive Design: Works on desktop, tablet, and mobile
- π¨ Professional Styling: Modern UI with gradients and shadows
- β‘ Fast Loading: Self-contained HTML with embedded CSS and JavaScript
| Count | Error Family |
|---|---|
| 850 | WSIAuthenticatorImpl login exception (authentication failures) |
| 548 | checkNameCollision / FNRCE0043E (E_NOT_UNIQUE) β Name already exists |
| 10 | getContent failures (content retrieval) |
HTML Features:
- Interactive charts (hover for details)
- Click to expand/collapse example log entries
- Statistics cards showing totals and trends
- Professional color scheme and typography
| Option | Description |
|---|---|
--pattern |
File glob pattern (default: *.log) |
--since |
Relative start (e.g., 24h, 2d6h) |
--until |
Relative end (default: 0h = now) |
--outdir |
Directory for reports and CSVs |
--examples |
Example rows per family (default: 3) |
| Option | Description |
|---|---|
--pdf-report |
Output path for PDF file |
--pdf-title |
Custom report title |
--pdf-logo |
Optional logo image for title page |
--pdf-landscape |
Generate PDF in landscape orientation (recommended) |
| Option | Description |
|---|---|
--html-report |
Output path for HTML file (e.g., ./report.html) |
--html-title |
Custom report title for HTML output |
| Option | Description |
|---|---|
--kube-sync |
Copy logs from Kubernetes before analysis |
--kube-namespace |
Namespace (e.g. filenet) |
--kube-pod-prefix |
Pod name prefix |
--kube-container |
Container name |
--kube-remote-path |
Path inside container |
--kube-local-path |
Local destination directory |
--kube-file-pattern |
Remote file pattern (e.g. ce_system*.log) |
--kube-single |
Use only one pod (shared log volume) |
--kube-flatten |
Do not create per-pod subfolders |
--kube-copy-mode |
One of: tar (default, robust), snapshot, cp |
| File | Description |
|---|---|
summary_markdown.md |
Markdown summary report |
summary.csv |
Summary of error families and counts |
examples.csv |
Example log entries per family |
raw_errors.csv |
All WARN/ERROR lines |
timeseries_overall_daily.csv |
Error count per day |
timeseries_overall_hourly.csv |
Error count per hour |
timeseries_family_daily.csv |
Error count per day per family |
timeseries_family_hourly.csv |
Error count per hour per family |
filenet_cpe_report.pdf |
Visual PDF report with charts |
report.html |
NEW: Interactive HTML report with embedded charts |
- IBM FileNet CPE 5.5.8 / 5.7 (Liberty)
- IBM Cloud Pak for Business Automation 24.0.x
- OpenShift 4.x / Kubernetes 1.27+
- Ubuntu 22.04, macOS 13+, Windows 11 (Python 3.10+)
# Step 1: Sync CPE logs from the running pod
python filenet_cpe_log_analyzer.py /tmp/analyze \
--kube-sync \
--kube-single \
--kube-flatten \
--kube-namespace filenet \
--kube-pod-prefix demo-cpe-deploy \
--kube-container demo-cpe-deploy \
--kube-remote-path /opt/ibm/wlp/usr/servers/defaultServer/FileNet \
--kube-local-path /tmp/analyze \
--kube-file-pattern "ce_system*.log" \
--pattern "ce_system*.log" \
--since "24h" \
--outdir ./results \
--pdf-report ./results/cpe_analysis.pdf \
--pdf-title "FileNet CPE Log Analysis β Last 24 Hours" \
--pdf-landscape
# Step 2: View the report
xdg-open ./results/cpe_analysis.pdf# Error overview (consolidated)
| Count | Error family |
|-------|---------------|
| 850 | WSIAuthenticatorImpl login exception (authentication failures) |
| 548 | checkNameCollision / FNRCE0043E (E_NOT_UNIQUE) β Name already exists |
| 10 | getContent failures (content retrieval) |
---
## Example entries per error family
### WSIAuthenticatorImpl login exception (authentication failures)
| Timestamp | Logfile | Example message |
|------------|----------|----------------|
| 2025-10-14T04:50:18.885 | ce_system0-cpe08.log | [WSIAuthenticatorImpl] login exception: Unable ... |Licensed under the Apache License 2.0.
See LICENSE for full terms.
In large-scale, distributed FileNet environments, logs are often scattered across multiple pods and rotated frequently.
While cloud-native observability (e.g., Loki, OpenShift logging) handles streaming well, sometimes you just need an offline, reproducible snapshot β this script provides exactly that.
Itβs ideal for:
- Migration and performance testing
- Offline troubleshooting (without cluster access)
- Quickly summarizing the most common error families
Inspired by real-world FileNet CPE scaling and migration projects.
The project now includes several enhanced versions with advanced capabilities:
New Features:
- Configuration Management: JSON-based configuration files with environment variable support
- Performance Monitoring: Real-time memory usage and processing speed tracking
- Enhanced Error Handling: Automatic encoding detection and graceful error recovery
- HTML Reports: Rich HTML reports with interactive visualizations
- Plugin Architecture: Extensible design for custom normalizers and processors
- Advanced Filtering: More sophisticated filtering and search capabilities
Configuration System (config.py):
- Centralized configuration management with validation
- Environment variable support for CI/CD pipelines
- Sample configuration generation and validation utilities
- Support for custom analysis parameters and output formats
Create and use configuration file:
# Create a sample configuration file
python config.py --create-sample ./my_config.json
# Use custom configuration
python advanced_filenet_cpe_log_analyzer.py /path/to/logs --config ./my_config.json
# Validate configuration
python config.py --validate ./my_config.jsonEnvironment variables:
export LOGANALYZER_FILE_PATTERN="*.log"
export LOGANALYZER_OUTPUT_FORMAT="html"
export LOGANALYZER_MAX_EXAMPLES="5"
python advanced_filenet_cpe_log_analyzer.py /path/to/logsPerformance monitoring:
python advanced_filenet_cpe_log_analyzer.py /path/to/logs --monitor-performance --verboseThe new configuration system supports:
{
"file_pattern": "*.log",
"max_file_size_mb": 1000,
"encoding": "utf-8",
"max_examples": 3,
"severity_levels": ["ERROR", "WARN", "WARNING", "FATAL", "SEVERE"],
"normalize_messages": true,
"max_pattern_length": 200,
"progress_interval": 1000,
"batch_size": 10000,
"enable_parallel_processing": false,
"output_format": "both",
"chart_dpi": 300,
"chart_width": 14,
"chart_height": 8,
"default_time_window": "24h",
"timezone": "UTC"
}- HTML Reports: Interactive HTML reports with embedded charts and filtering
- Enhanced JSON: Structured JSON with performance metrics and metadata
- Excel Support: Export to Excel format (when pandas is available)
- Performance Logs: Detailed performance and memory usage tracking