Splunk Search

Why is search syntax highlighting not working in Splunk 6.5.2?

sylim_splunk
Splunk Employee
Splunk Employee

Our search heads syntax highlighting does not function for any of search commands. This is with search_syntax_highlighting = true for the user prefs. I'm on Splunk version 6.5.2.

[general]
search_syntax_highlighting = 1
search_assistant = compact
infodelivery_enabled = 0
infodelivery_show_ad_modal = 1
infodelivery_show_configure_modal = 1
datasets:showInstallDialog = 1

What I do see if I look at the browser console output is this:

Uncaught TypeError: Cannot read property 'forEach' of undefined
at SPLHighlightRules.buildCommandTokens (https://mysearchhead:8000/en-US/static/@67571ef4b87d/js/contrib/ace-editor/mode-spl.js:20:27)
at SPLHighlightRules.buildRules (https://mysearchhead:8000/en-US/static/@67571ef4b87d/js/contrib/ace-editor/mode-spl.js:82:76)
at new SPLHighlightRules (https://mysearchhead:8000/en-US/static/@67571ef4b87d/js/contrib/ace-editor/mode-spl.js:339:10)
... SNIP ...
at _require (eval at module.exports (https://mysearchhead:8000/en-US/static/@A0893C21C54BF1F3227A8F08…2162F01813C1C30FC75598EC33A535BB920...), :88:37)
at req (eval at module.exports (https://mysearchhead:8000/en-US/static/@A0893C21C54BF1F3227A8F08…2162F01813C1C30FC75598EC33A535BB920...), :138:24)

alt text

0 Karma
1 Solution

sylim_splunk
Splunk Employee
Splunk Employee

This case turned out to be caused by malformatted searchbnf.conf in a few custom apps, like it lacks mandatory field of "SYNTAX". - If you have the same issue I would recommend you to check if you have custom searchbnf.conf - Strangely, the small mistakes affect the whole feature to stop working which will be improved in the next version of 6.5.4 onward - it would ignore and work around the mistakes and continue to work for the other good commands.

View solution in original post

sylim_splunk
Splunk Employee
Splunk Employee

This case turned out to be caused by malformatted searchbnf.conf in a few custom apps, like it lacks mandatory field of "SYNTAX". - If you have the same issue I would recommend you to check if you have custom searchbnf.conf - Strangely, the small mistakes affect the whole feature to stop working which will be improved in the next version of 6.5.4 onward - it would ignore and work around the mistakes and continue to work for the other good commands.

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...