Extracting metrics from logs