Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Splunk spath vs plain search performance

Assuming that I have json logs formatted like

{
    level: INFO,
    logger: com.mantkowicz.test.TestLogger,
    message: Just a simple test log message
}

what is the difference between such two searches:

A) ... | message = "Just a simple test log message"
B) ... | spath message | search message = "Just a simple test log message"

Is there any performance drawback? Should I prefer one of these?

like image 360
m.antkowicz Avatar asked Sep 06 '25 13:09

m.antkowicz


2 Answers

You should probably go with the first approach and remove the need for spath.

Depending on your use case, you could also look at JSON indexed extractions, KV_MODE=json which can do the field extractions at index time, rather than every search.

like image 71
Simon Duff Avatar answered Sep 08 '25 11:09

Simon Duff


You may find that search A doesn't work if there is no 'message' field extracted. In that case, you'll need search B or extract fields at index-time as @Simon Duff suggested.

like image 32
RichG Avatar answered Sep 08 '25 11:09

RichG