- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Add comments to search code inside search field
Hello everybody, using Splunk 8.1.0 and relaterd to https://docs.splunk.com/Documentation/Splunk/8.1.0/Search/Parsingsearches trying to add comments via ```my_comment``` to search request, but there is error.
Only `comment("my_comment")` works, but it is not what i need...
How to add comment to search request like /* my_comment */ or // my_comment ?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi @sergeblr may we know your full search query(after hiding hostname, important field-values) and Splunk version please
Sekar
PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, @inventsekar
index=apps host=host* CASE(ERROR) AND "com.*" ```some comment here```
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

index=apps host=host* ERROR ```some comment here```
are you able to do this search, please check.
Sekar
PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Returns
Error in 'SearchParser': You must provide a macro expression.
Splunk 8.0.1
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

please try this... (this works fine for me)
index=_internal CASE(ERROR) /*test*/
PS - karma points appreciated, if this solves your question, please accept it as the solution. thanks.
Sekar
PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For this query /*test*/ parsed as:
'/' symbol, THEN any text (*), THEN 'test' word, THEN again any text (*) and '/' symbol, so this is not parsed as comment :((
