File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,11 @@ class SplunkBackend(TextQueryBackend):
199199 deferred_separator : ClassVar [str ] = "\n | "
200200 deferred_only_query : ClassVar [str ] = "*"
201201
202+ # Pattern matching a leading field=value term in a query string.
203+ _field_eq_val_re : ClassVar [Pattern ] = re .compile (
204+ r'([\w.]+)(?:="[^"]*"|=[^\s")]+)\s*'
205+ )
206+
202207 # Correlations
203208 correlation_methods : ClassVar [Dict [str , str ]] = {
204209 "stats" : "Correlation using stats command (more efficient, static time window)" ,
@@ -356,11 +361,8 @@ def finish_query(
356361 # inside the trailing "| search" clause.
357362 prefix_parts = []
358363 pos = 0
359- field_eq_val_re = re .compile (
360- r'([\w.]+)(?:="[^"]*"|=[^\s")]+)\s*'
361- )
362364 while pos < len (query ):
363- m = field_eq_val_re .match (query , pos )
365+ m = self . _field_eq_val_re .match (query , pos )
364366 if m and m .group (1 ) not in deferred_condition_fields :
365367 prefix_parts .append (m .group ().strip ())
366368 pos = m .end ()
You can’t perform that action at this time.
0 commit comments