Splunk Search

how to match partial string in search query

sravankaripe
Communicator

Hi

I have a errors in the field (say myfield)

Error xyz : 123
Error xyz : 456
Error xyz : 789
Error xyz : 135
Error xyz : 987

i want to group it by matching the partial values of a string like
| eval myfield=if(myfield=="Error xyz*","Error xyz",myfield)

So myfields should contain values

"Error xyz" and other errors
(i am tring to group myfield values which starts with "Error xyz" )
how can i do this

Tags (2)
0 Karma
1 Solution

SplunkersRock
Path Finder

try this

| eval temp= mvfilter(match(myfield,"Error xyz")) | eval myfield=if(myfield==temp,"Error xyz",myfield)

if it won't work, please provide me more info

View solution in original post

SplunkersRock
Path Finder

try this

| eval temp= mvfilter(match(myfield,"Error xyz")) | eval myfield=if(myfield==temp,"Error xyz",myfield)

if it won't work, please provide me more info

Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...