When trying to run a query to check data in fields that contains special characters, it would return a different output. If the query uses the field’s special character without quotes or escaping, it returns the following results:
index="test" user=!user2789 OR user0089 | stats count by user action app os

If the field containing special characters is run inside parenthesis, it would return unexpected results.
For example:
index="test" user IN (!user2789, user0089) | stats count by user action app os

To investigate this issue perform the following steps:
INFO SearchParser [424926 searchOrchestrator] - PARSING: | search (index="test" (user=! OR user=user2789 OR user=user0089))
INFO UnifiedSearch [424926 searchOrchestrator] - Expanded index search = (index="test" user (=! OR user=user2789 OR user=user0089))
INFO UnifiedSearch [424926 searchOrchestrator] - Expanded filtering search = (index="test" (user=! OR user=user2789 OR user=user0089))
Thera are characters that have special meaning in a search and to avoid the Search Processing Language (SPL) to interpreter these characters differently; these characters should be escaped.
The following characters can be used to escape or ignore these special characters:
There is a table that contain some Rules for when to use escape characters, that can be checked depending on the case scenario.
In this example, search literals were used to escape the "exclamation point !" which is a Major breaker.
For example:
index="test" user IN ("!user2789", user0089) | stats count by user action app os

If the search is inspected again, it shows that the SearchParser and UnifiedSearch components are looking only into the fields mentioned on the search.
INFO SearchParser [428103 searchOrchestrator] - PARSING: | search (index="test" (user="!user2789" OR user=user0089))
UnifiedSearch [428103 searchOrchestrator] - Expanded index search = (index="test" (user="!user2789" OR user=user0089))
Rules for when to use escape characters
Wildcards, quotes, and escape characters
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
01-Oct-2026
|
Initial Release |