Getting Data In

Extract a string from an existing field value

avkchare
Loves-to-Learn

Hi guys,

I have the following event:

[DefaultMessageHistory[routeId=Receive, node=to618]], CamelToEndpoint=log://nl.vvv.kip.interfaces.timetellinboundtimecards.Receive?level=INFO&multiline=true&showAll=true&style=Fixed} Headers {breadcrumbId=ID-localhost-2206437765421-19-3, CamelFileAbsolute=true, CamelFileAbsolutePath=/data/bamba/Simebards
 
What I need is a regular expression to extract the word timetellinboundtimecards and I want to rename it service-name.
Furthermore, i need another regular expression to extract the word Receive (or Request or send or Failed)  and rename it to status.
 
Please let me know if you have the solution for this problem.
Kind regards,
K.C.
 
 
Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What have you tried so far?

---
If this reply helps you, Karma would be appreciated.
0 Karma

avkchare
Loves-to-Learn

Hi Richgalloway,

To extract the word timetellinboundtimecards I used the following search query:

index=vip-ota Logger=nl.vvv.kip.interfaces.TimetellInboundTimecards.*
| rex "CamelToEndpoint=log:\/\/nl\.vvv\.kip\.interfaces\.(?<serviceName>.*)+\?level"
| table _time, serviceName

Kind Regards,

K.C.

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Your regex was close.  This one worked for me with your sample event.

CamelToEndpoint=log:\/\/nl\.vvv\.kip\.interfaces\.(?<serviceName>[^\.]+)\.(?<status>[^\?]+)\?

Are you familiar with the web site regex101.com for testing regular expressions? 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...