Back to Library
DevOps

SQL Log Duration

Extract SQL query durations from logs in milliseconds.

Pattern
\bduration=(\d+(?:\.\d+)?)ms\b

Test Cases

duration=15.2ms query=SELECT 1 Match
took 15ms No Match

Related Blog Guides

Regex Patterns for Log Parsing: 7 Production-Ready Recipes

Use battle-tested regex patterns to extract timestamps, status codes, trace IDs, and error messages from noisy application logs.

Regex Release Checklist: Quality Gates Before Shipping

A release checklist for regex-heavy systems covering correctness tests, performance thresholds, engine parity checks, and rollout safeguards.

Regex Fuzz Testing Playbook: Finding Edge Cases Automatically

Use fuzzing to discover correctness bugs and performance cliffs in regular expressions before attackers or weird data find them first.

Try it Live

Test and customize this pattern in our interactive editor

Open in Editor
About Blog Patterns Cheatsheet GitHub

© 2026 TestRegex.