A regular expression describes text, not business meaning. An unanchored search for ERROR also finds ERRORish. Anchor the beginning and include the delimiter after a whole severity word. Extended expressions allow alternatives with a vertical bar, and the ignore-case option handles differently capitalized records. Quote the expression so the shell doesn't interpret it first.
Test the borderline rows rather than relying only on an obvious match. In '^(ERROR|WARNING) ', the caret fixes the match at the start, the parentheses group alternatives, and the trailing space separates the severity from the message. grep -E enables that grouping syntax; -i ignores case. A matching line is returned once even if its message contains another occurrence of the pattern.