Splunk Search

Removing Characters After First Space for a Field in Splunk

CodingMaestro
Path Finder

Hello,

I have following results like below:

HostTypeType Duplicate Field 
ABCDCoca ColaCoca Cola
EFGH7up - Sprite7up - Sprite

 

but i want my search for the Type Duplicate Field to remove anything after the first space so my table should like below:

HostTypeType Duplicate Field 
ABCDCoca ColaCoca
EFGH7up - Sprite7up

 

Any help would be greatly appreciated. 😀

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval "Type Duplicated Field" = mvindex(split('Type Duplicated Field', " "), 0)

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval "Type Duplicated Field" = mvindex(split('Type Duplicated Field', " "), 0)
0 Karma

CodingMaestro
Path Finder

Thank You. Worked Perfectly.

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...