Splunk Search

How to extract last words?

akshayinnamuri
Loves-to-Learn Lots

Hi I have sample like this

Source                                                                      
Sample time from tx-templated               
efghi examl from templated                        
Sample time from [templated]       

I want to extract the the values of last word as show below 

Source                                                                  Extract Value
Sample time from tx-templated               tx-templated
efghi examl from templated                        templated
Sample time from [templated]                   templated           

 

how to do via regex?

 

Thanks in advance for help

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| rex "(?<lastword>[\w-]+)\W*?$"
0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...