Splunk Search

Extracting fields for a specific text

datamine
Loves-to-Learn Lots

hi All,

Am trying to extract the fields for only the text when it contains start or end as my test_status field that should contain only those values and the value next to the test_status field as my test_name example:DeVone_Benchmarking_Suite. When am trying auto regex and delimiter like space am getting other values as well in those field which am not interested. Can someone help me how to extract only those values in my fields.

Please find the sample events below.

[2019-11-24T13:20:48.226-0500][580.588s] GC(8) Garbage Collection (Allocation Rate) 8532M(69%)->2574M(21%)

[2019-11-24T13:18:28.315-0500][440.678s] GC(7) Garbage Collection (Allocation Rate) 11414M(93%)->1744M(14%)

[2019-11-24T13:16:13.876-0500][306.239s] GC(6) Garbage Collection (System.gc()) 2560M(21%)->1268M(10%)

[2019-11-24T13:16:12.570-0500][304.932s] GC(5) Garbage Collection (Allocation Rate) 8270M(67%)->2560M(21%)

[2019-11-24T13:14:01.328-0500][173.690s] GC(4) Garbage Collection (Allocation Rate) 11576M(94%)->1758M(14%)

[2019-11-24T13:11:14.353-0500][6.716s] GC(0) Garbage Collection (Warmup) 1264M(10%)->958M(8%)

[2019-11-24T13:11:07.709-0500][0.071s] Using The Z Garbage Collector

[2019-11-24T13:11:07-05:00] DEVJVM-Test-Start DeVone_Benchmarking_Suite SEGUE1401_12GB_MEMORY

[2019-11-24T13:11:07-05:00] DEVJVM-Test-End DeVone_Benchmarking_Suite

[2019-11-24T13:11:06.014-0500][1491.413s] GC(23) Garbage Collection (Allocation Rate) 2514M(22%)->1832M(16%)

[2019-11-24T13:10:55.376-0500][1480.775s] GC(22) Garbage Collection (Allocation Rate) 9108M(81%)->1500M(13%)

[2019-11-24T13:08:21.376-0500][1326.775s] GC(21) Garbage Collection (Allocation Rate) 10124M(90%)->1682M(15%)

Thanks,
Devon

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The auto regex tool leaves a little to be desired. Try this manual regex: (?<test_status>(Test-Start|Test-End)\s(?<test_name>\S+)

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

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

^\S+\s+GC\((?<GC_stage>\d+)\)\s+Garbage Collection \((?<_KEY_1>.+?)\)\s+(?<_VAL_1>.*)$

Plus this:
https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Configureadvancedextractionswithfieldt...

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The auto regex tool leaves a little to be desired. Try this manual regex: (?<test_status>(Test-Start|Test-End)\s(?<test_name>\S+)

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...