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!

.conf24 | Registration Open!

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

Splunk is officially part of Cisco

Revolutionizing how our customers build resilience across their entire digital footprint.   Splunk ...

Splunk APM & RUM | Planned Maintenance March 26 - March 28, 2024

There will be planned maintenance for Splunk APM and RUM between March 26, 2024 and March 28, 2024 as ...