extract patterns from logs