Splunk Search

How do I create the regex to extract this field from my sample data?

Splunk_rocks
Path Finder

I have a events like below in my servers so I want write a search to extract tps(cur) value in a table format with _time it is occurred. I have tried regex as well as the Field Extractor, but nothing has worked. Any help is greatly appreciated.

Nov 28, 2015 3:57:59 AM com.xxrklogic.developer.XXX.Monitor monitorResults
INFO: completed all tasks 1428872/1428872, 548 tps(avg), 612 tps(cur), ETC 00:00:00, 0 active threads.
0 Karma

diogofgm
SplunkTrust
SplunkTrust

try this:

<your search>| rex field=_raw "\s+(?<tpscur>\d+)\s+tps\(cur\)" | table _time tpscur

off course if you intend to use this often just do a field extraction so you dont have to use the rex command in que search

------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma

jplumsdaine22
Influencer

Have you tried testing your regular expression with a tool like https://www.debuggex.com/ ? If you post the full search string that has failed for you (including the regex command) we can help you with your regex

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...