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
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...