Splunk Search

transaction startswith match not exact

FRoth
Contributor

I noticed that the "startswith" expression does not match exactly.

startswith="Sophos Anti-Virus service entered the stopped"

The statement above created transactions containing this string:

Message=The Sophos Anti-Virus Statusreporter service entered the stopped state.

Notice that the word "Statusreporter" does not appear in the string defined as the start of the transaction. Is there a way to make it match exactly?

gpullis
Communicator

Sending escaped quotes to the searchmatch function of eval worked for me:

startswith=eval(searchmatch"\"Sophos Anti-Virus service entered the stopped\""))
0 Karma

paddygriffin
Path Finder

Is the text in a field? If so an eval expression would be one solution
startswith=eval(thefieldname=="Sophos Anti-Virus service entered the stopped")
If there's further text in the field following this phrase you could use a wildcard at the end.
"Sophos Anti-Virus service entered the stopped*"
If it's not a pre-defined (persistent) field you could use rex or erex to create a transient field before the transaction command and use that in the startswith/ eval.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...