How to exclude a particular string from set of server logs
Andrew Henderson
I am new to Splunk and would appreciate if anyone helps me on this. I would like to know the splunk query- for properties that have this log "not found in cache and enable, trying to return from" and NOT have "No content returned for" , this particular log These strings are on a different line
INFO - Service - Getting content=tItem for property=79551
INFO - Service - content=Item "not found in cache and enable, trying to return from",property=79551
INFO - Service - "Returning content from" resource=Item property=79551
INFO - Service - content=Item "not found in cache and is healthy, trying to return from",property=79551
INFO - Service - "No content returned for" property=79551, content=Item
sumarising once-more the condition include "not found in cache and enable, trying to return from" and exclude "No content returned for" need to have such properties as the final result.
Can someone kindly help me on this.
1 Answer
Excluding a string from search results is just a matter of using the NOT operator with the undesired string.
index=foo "not found in cache and enable, trying to return from" NOT "No content returned for" 4