Use the HTML entity: < & >
If you construct a search in the UI view, then go to edit source, you’ll see that’s how Splunk converts it under the hood
from User warren – Stack Overflow https://stackoverflow.com/questions/62506677/splunk-escaping-from-the-dashboards-source-code/62526810#62526810
via IFTTT