Splunk Search

i want to match the text "followed the escaped error:" and remove the following text till the delimiter dot. it should cut other fields

DataOrg
Builder

followed the escaped error: "An error has happened executing a dash statement. hello good morning
followed the escaped error: "6g is not a valid for Value of the statement. happy morning

0 Karma
1 Solution

dineshraj9
Builder

Can you try replace command -

E.g.

| makeresults | eval text="followed the escaped error: \"An error has happened executing a dash statement. hello good morning" | eval text=replace(text,"\:[^\.]+","")

View solution in original post

woodcock
Esteemed Legend

Like this:

| makeresults 
| eval text="followed the escaped error: \"An error has happened executing a dash statement. hello good morning" 
| rex field=text mode=sed "s/\:[^\.]+//"

dineshraj9
Builder

Can you try replace command -

E.g.

| makeresults | eval text="followed the escaped error: \"An error has happened executing a dash statement. hello good morning" | eval text=replace(text,"\:[^\.]+","")

DataOrg
Builder

it should not cut other following fields only it should till dot

0 Karma
Get Updates on the Splunk Community!

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...