Splunk Search

Long-winded expressions in transaction's startsWith

unitedmarsupial
Path Finder

Our application's log-entries are in JSON and I need to search for certain strings found in the field called message.

I have no problem finding them with a regular search:

... AND (message="Application is closing." OR message="successfully started")

However, when I try to define a transaction with the seemingly same search criteria:

...
| transaction source startsWith="message=\"Application is closing.\"" endsWith="message=\"successfully started\""

I get zero results... Am I escaping the quotes incorrectly or making some other syntax error?

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust
0 Karma

unitedmarsupial
Path Finder

@isoutamo wrote:

have you tried this?


Sorry, I don't see, how it would help me -- my problem is not, that only a substring is matched... Our log-entries are structured (JSON) and, consequently, the search-string contains quotes of its own.

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Can you post sample events (scrambled)?

0 Karma

unitedmarsupial
Path Finder

Here is the sample:

12/21/21
7:43:43.000 PM
{
   logger: connectivity.runner.Runner
   message: Managed service successfully started
   severity: INFO
   thread: main
   time: 1640133823.948

}
 
  • host = rt22a10031pv00
  • source = PROD
  • sourcetype = log4j2
12/21/21
7:42:02.000 PM
{
   logger: connectivity.core.shutdown.GracefulShutdownStrategy
   message: Application is closing. Running commands will end with partial results.
   severity: WARN
   thread: Thread-6
   time: 1640133722.085

}
 
  • host =rt22a10031pv00
  • source = PROD
  • sourcetype = log4j2
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...