Library Usage
Using patterndb-yaml as a Python library.
Installation
Quick Start
from patterndb_yaml import PatterndbYaml
from pathlib import Path
# Create processor
processor = PatterndbYaml(rules_path=Path("rules.yaml"))
# Process logs
with open("input.log") as infile, open("output.log", "w") as outfile:
processor.process(infile, outfile)
# Get statistics
stats = processor.get_stats()
print(f"Match rate: {stats['match_rate']:.1%}")
See Also
- PatterndbYaml API - Complete API reference
- CLI Reference - Command-line interface
- Rules Documentation - Pattern syntax