Has anyone noticed that when you comment out a bit of code in splunk simple XML dashboard, and then save it.
ANd then go back later to edit the same dashboard, the commented out code has moved to the top.
Any one notice this? Can it be made to not happen? I want the code to stay where it is.
I find this useful for comparing an old query chart with an new edited one, but this moving the commented code makes this hard.
Anyone any ideas or suggestions? I guess I could use the clone option but that does not really work for this scenario.
This happens when you save the dashboard from editing in UI mode - if you want comments to stay, you need to edit in source mode, but I've found that there's always the one save you forget to do and all the comments move...
If you want SPL code comments, then the best option is to create a simple eval based macro that returns "" and use
`c("This is a comment")`
where c is the macro
Don't think there is a way to prevent the move otherwise.
I use the comment all the time in searches, both in dashboards and saved searches, it provides a really good way to document the search and, in particular, the usage of tokens in the search, how they are set and their scope. My understanding is that there is no real cost implication in using this type of eval macro.