Splunk Search

What is the Splunk regular expression to remove characters/number after second space?

DataOrg
Builder

i want the data to be deleted after a second space.

EX:data is like this "lenovo thinkcentre 6.7" and i want "lenovo thinkcentre"

lenovo thinkcentre 6.7 --- lenovo thinkcentre
DELL workspace (FULL server) --- DELL workspace
samsung S8 full version. ----- samsung S8
0 Karma
1 Solution

kmorris_splunk
Splunk Employee
Splunk Employee

If this data is already extracted into a field try:

... | rex field=yourfield "^(?<myval>\w+\s+\w+)\s+"

View solution in original post

mstjohn_splunk
Splunk Employee
Splunk Employee

hi @premranjithj

Did the answer below solve your problem? If so, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help ya. Thanks for posting!

0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

If this data is already extracted into a field try:

... | rex field=yourfield "^(?<myval>\w+\s+\w+)\s+"
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...