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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...