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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...